Skip to content

Commit 62d4898

Browse files
shcgitsre
authored andcommitted
power: reset: at91-reset: Optimize at91_reset()
This patch adds a small optimization to the low-level at91_reset() function, which includes: - Removes the extra branch, since the following store operations already have proper condition checks. - Removes the definition of the clobber register r4, since it is no longer used in the code. Fixes: fcd0532 ("power: reset: at91-reset: make at91sam9g45_restart() generic") Signed-off-by: Alexander Shiyan <eagle.alexander923@gmail.com> Reviewed-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Link: https://lore.kernel.org/r/20250307053809.20245-1-eagle.alexander923@gmail.com Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
1 parent 51212ce commit 62d4898

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

drivers/power/reset/at91-reset.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,11 @@ static int at91_reset(struct notifier_block *this, unsigned long mode,
129129
" str %4, [%0, %6]\n\t"
130130
/* Disable SDRAM1 accesses */
131131
"1: tst %1, #0\n\t"
132-
" beq 2f\n\t"
133132
" strne %3, [%1, #" __stringify(AT91_DDRSDRC_RTR) "]\n\t"
134133
/* Power down SDRAM1 */
135134
" strne %4, [%1, %6]\n\t"
136135
/* Reset CPU */
137-
"2: str %5, [%2, #" __stringify(AT91_RSTC_CR) "]\n\t"
136+
" str %5, [%2, #" __stringify(AT91_RSTC_CR) "]\n\t"
138137

139138
" b .\n\t"
140139
:
@@ -145,7 +144,7 @@ static int at91_reset(struct notifier_block *this, unsigned long mode,
145144
"r" cpu_to_le32(AT91_DDRSDRC_LPCB_POWER_DOWN),
146145
"r" (reset->data->reset_args),
147146
"r" (reset->ramc_lpr)
148-
: "r4");
147+
);
149148

150149
return NOTIFY_DONE;
151150
}

0 commit comments

Comments
 (0)