Thread (3 messages) flat view 3 messages, 2 authors, 21h ago

Re: [PATCH] powerpc/boot: Mark exit() and ps3_exit() as __noreturn

From: "Christophe Leroy (CS GROUP)" <chleroy@kernel.org>
Date: 2026-08-07 15:32:53
Also in: lkml


Le 07/08/2026 à 17:23, Thorsten Blum a écrit :
Since neither exit() nor ps3_exit() return, annotate both functions with
the __noreturn attribute to improve compiler optimizations.
Is it worth spending time optimising a boot sequence that will run only 
once at startup ?

Do you have any figure on the improvement ?

Christophe
quoted hunk ↗ jump to hunk
Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
  arch/powerpc/boot/ops.h | 2 +-
  arch/powerpc/boot/ps3.c | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/boot/ops.h b/arch/powerpc/boot/ops.h
index a40c2162a4e9..df52b14816e2 100644
--- a/arch/powerpc/boot/ops.h
+++ b/arch/powerpc/boot/ops.h
@@ -217,7 +217,7 @@ static inline void free(void *ptr)
  		platform_ops.free(ptr);
  }
  
-static inline void exit(void)
+static inline void __noreturn exit(void)
  {
  	if (platform_ops.exit)
  		platform_ops.exit();
diff --git a/arch/powerpc/boot/ps3.c b/arch/powerpc/boot/ps3.c
index 89ff46b8b225..22fa35960926 100644
--- a/arch/powerpc/boot/ps3.c
+++ b/arch/powerpc/boot/ps3.c
@@ -45,7 +45,7 @@ static void ps3_console_write(const char *buf, int len)
  {
  }
  
-static void ps3_exit(void)
+static void __noreturn ps3_exit(void)
  {
  	printf("ps3_exit\n");
  
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help