Skip to contentSkip to conversation

powerpc/boot: Add missing __noreturn annotations

PATCH New Thorsten Blum 1 participant 1 message Nov 5

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 powerpc/boot: Add missing __noreturn annotations

Mark start(), exit(), ps3_exit(), and the PS3 platform_init() as __noreturn to document that they never return and to potentially improve compiler optimizations.

---
Changes in v2:
- Update patch subject and description
- Mark start() and platform_init() as __noreturn
- v1: https://lore.kernel.org/r/[email protected]/

 arch/powerpc/boot/ops.h | 4 ++--
 arch/powerpc/boot/ps3.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
arch/powerpc/boot/ops.h +2 -2
index a40c2162a4e9..42b2721dbe61 100644
@@ -80,7 +80,7 @@ struct loader_info {
 };
 extern struct loader_info loader_info;
 
-void start(void);
+void __noreturn start(void);
 void fdt_init(void *blob);
 int serial_console_init(void);
 int ns16550_console_init(void *devp, struct serial_console_data *scdp);
@@ -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 +2 -2
index 89ff46b8b225..f94d3818815a 100644
@@ -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");
 
@@ -100,7 +100,7 @@ void ps3_copy_vectors(void)
 	flush_cache((void *)0x100, 512);
 }
 
-void platform_init(void)
+void __noreturn platform_init(void)
 {
 	const u32 heapsize = 0x1000000 - (u32)_end; /* 16MiB */
 	void *chosen;