Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: fcd0532fac2a ("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>

authored by

Alexander Shiyan and committed by
Sebastian Reichel
62d48983 51212ce9

+2 -3
+2 -3
drivers/power/reset/at91-reset.c
··· 129 129 " str %4, [%0, %6]\n\t" 130 130 /* Disable SDRAM1 accesses */ 131 131 "1: tst %1, #0\n\t" 132 - " beq 2f\n\t" 133 132 " strne %3, [%1, #" __stringify(AT91_DDRSDRC_RTR) "]\n\t" 134 133 /* Power down SDRAM1 */ 135 134 " strne %4, [%1, %6]\n\t" 136 135 /* Reset CPU */ 137 - "2: str %5, [%2, #" __stringify(AT91_RSTC_CR) "]\n\t" 136 + " str %5, [%2, #" __stringify(AT91_RSTC_CR) "]\n\t" 138 137 139 138 " b .\n\t" 140 139 : ··· 144 145 "r" cpu_to_le32(AT91_DDRSDRC_LPCB_POWER_DOWN), 145 146 "r" (reset->data->reset_args), 146 147 "r" (reset->ramc_lpr) 147 - : "r4"); 148 + ); 148 149 149 150 return NOTIFY_DONE; 150 151 }