summaryrefslogtreecommitdiff
path: root/drivers/power
diff options
context:
space:
mode:
authorAlexander Shiyan <eagle.alexander923@gmail.com>2025-03-07 08:38:09 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-06-27 11:07:07 +0100
commit6f14ce3d209f6ae1bbdc787f23af21b43423085d (patch)
treeba16569dafa583536072199ef9ad25a17987a829 /drivers/power
parentac009b40ace4c6ec00d50cf2be65cda257ffb06e (diff)
downloadlinux-6f14ce3d209f6ae1bbdc787f23af21b43423085d.tar.gz
linux-6f14ce3d209f6ae1bbdc787f23af21b43423085d.tar.bz2
linux-6f14ce3d209f6ae1bbdc787f23af21b43423085d.zip
power: reset: at91-reset: Optimize at91_reset()
[ Upstream commit 62d48983f215bf1dd48665913318101fa3414dcf ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/reset/at91-reset.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/power/reset/at91-reset.c b/drivers/power/reset/at91-reset.c
index 741e44a017c3..f47346a0f099 100644
--- a/drivers/power/reset/at91-reset.c
+++ b/drivers/power/reset/at91-reset.c
@@ -128,12 +128,11 @@ static int at91_reset(struct notifier_block *this, unsigned long mode,
" str %4, [%0, %6]\n\t"
/* Disable SDRAM1 accesses */
"1: tst %1, #0\n\t"
- " beq 2f\n\t"
" strne %3, [%1, #" __stringify(AT91_DDRSDRC_RTR) "]\n\t"
/* Power down SDRAM1 */
" strne %4, [%1, %6]\n\t"
/* Reset CPU */
- "2: str %5, [%2, #" __stringify(AT91_RSTC_CR) "]\n\t"
+ " str %5, [%2, #" __stringify(AT91_RSTC_CR) "]\n\t"
" b .\n\t"
:
@@ -144,7 +143,7 @@ static int at91_reset(struct notifier_block *this, unsigned long mode,
"r" cpu_to_le32(AT91_DDRSDRC_LPCB_POWER_DOWN),
"r" (reset->data->reset_args),
"r" (reset->ramc_lpr)
- : "r4");
+ );
return NOTIFY_DONE;
}