Skip to contentSkip to conversation

riscv: Mark default_power_off() as __noreturn

PATCH In review Thorsten Blum 2 participants 2 messages Jul 27 – Jul 29 RISC-V

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 riscv: Mark default_power_off() as __noreturn

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

---
 arch/riscv/kernel/reset.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/kernel/reset.c +1 -1
index 912288572226..2ae2e724f385 100644
@@ -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();
maintainer
#1 lore raw
Quoted 4 lines · Thorsten Blum

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

Thanks, queued for v7.3.

- Paul