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

Signed-off-by: Thorsten Blum <[email protected]>
---
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(-)

diff --git a/arch/powerpc/boot/ops.h b/arch/powerpc/boot/ops.h
index a40c2162a4e9..42b2721dbe61 100644
--- a/arch/powerpc/boot/ops.h
+++ b/arch/powerpc/boot/ops.h
@@ -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();
diff --git a/arch/powerpc/boot/ps3.c b/arch/powerpc/boot/ps3.c
index 89ff46b8b225..f94d3818815a 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");
 
@@ -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;

Reply via email to