[PATCH] riscv: Mark default_power_off() as __noreturn

Thorsten Blum thorsten.blum at linux.dev
Mon Jul 27 03:03:39 PDT 2026


Since default_power_off() never returns, annotate it with the __noreturn
attribute to improve compiler optimizations.

Signed-off-by: Thorsten Blum <thorsten.blum at linux.dev>
---
 arch/riscv/kernel/reset.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/riscv/kernel/reset.c b/arch/riscv/kernel/reset.c
index 912288572226..2ae2e724f385 100644
--- a/arch/riscv/kernel/reset.c
+++ b/arch/riscv/kernel/reset.c
@@ -6,7 +6,7 @@
 #include <linux/reboot.h>
 #include <linux/pm.h>
 
-static void default_power_off(void)
+static void __noreturn default_power_off(void)
 {
 	while (1)
 		wait_for_interrupt();



More information about the linux-riscv mailing list