powerpc/boot: Mark exit() and ps3_exit() as __noreturn
Subsystems (2)
PATCH 1/1 powerpc/boot: Mark exit() and ps3_exit() as __noreturn
Since neither exit() nor ps3_exit() return, annotate both functions with the __noreturn attribute to improve compiler optimizations.
--- arch/powerpc/boot/ops.h | 2 +- arch/powerpc/boot/ps3.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/boot/ops.h +1 -1
@@ -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 ();
arch/powerpc/boot/ps3.c +1 -1
@@ -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" );
Christophe Leroy (CS GROUP)
reviewerLe 07/08/2026 à 17:23, Thorsten Blum a écrit :
Quoted 2 lines
Since neither
exit()norps3_exit()return, annotate both functions with the__noreturnattribute 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 33 lines
Signed-off-by Thorsten Blum <[email protected]>--- arch/powerpc/boot/ops.h | 2 +- arch/powerpc/boot/ps3.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)arch/powerpc/boot/ops.h +1
-1@@ -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 ();arch/powerpc/boot/ps3.c +1
-1@@ -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" );
Quoted 8 lines · Christophe Leroy (CS GROUP)
Le 07/08/2026 à 17:23, Thorsten Blum a écrit :
Quoted 2 lines
Since neither
exit()norps3_exit()return, annotate both functions with the__noreturnattribute 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 ?
No, and I haven't checked its impact. Maybe compilers can already infer that both functions never return and optimize them accordingly. Besides potential compiler optimizations, it also serves as documentation.
I can reword the commit message to clarify that, or drop the patch.
Thanks,
Thorsten