Skip to contentSkip to conversation

m68k: amiga: Mark amiga_reset() as __noreturn

PATCH In review Thorsten Blum 3 participants 5 messages Jun 26 – Jun 29 m68k architecture

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 m68k: amiga: Mark amiga_reset() as __noreturn

Mark both the forward declaration and the function definition as __noreturn, and remove the redundant redeclaration.

---
Changes in v2:
- Specify the __noreturn attribute before the function name to avoid a compile-time error (Daniel)
- v1: https://lore.kernel.org/r/[email protected]/

---
 arch/m68k/amiga/config.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
arch/m68k/amiga/config.c +2 -4
index 242d18e750b0..7b72d964577a 100644
@@ -96,7 +96,7 @@ static char amiga_model_name[13] = "Amiga ";
 static void amiga_sched_init(void);
 static void amiga_get_model(char *model);
 static void amiga_get_hardware_list(struct seq_file *m);
-static void amiga_reset(void);
+static void __noreturn amiga_reset(void);
 static void amiga_mem_console_write(struct console *co, const char *b,
 				    unsigned int count);
 #ifdef CONFIG_HEARTBEAT
@@ -543,9 +543,7 @@ static u64 amiga_read_clk(struct clocksource *cs)
 	return ticks;
 }
 
-static void amiga_reset(void)  __noreturn;
-
-static void amiga_reset(void)
+static void __noreturn amiga_reset(void)
 {
 	unsigned long jmp_addr040 = virt_to_phys(&&jmp_addr_label040);
 	unsigned long jmp_addr = virt_to_phys(&&jmp_addr_label);
Tested-by on v2 1/1
#1 lore raw

Hi Thorsten,

Quoted 3 lines · Thorsten Blum

Mark both the forward declaration and the function definition as __noreturn, and remove the redundant redeclaration.

<snip>

Boot tested on my A4000, rebooting still works. So FWIW:

#2 lore raw
Quoted 11 lines · Daniel Palmer

Hi Thorsten,

Quoted 3 lines · Thorsten Blum

Mark both the forward declaration and the function definition as __noreturn, and remove the redundant redeclaration.

<snip>

Boot tested on my A4000, rebooting still works. So FWIW:

Thank you!

#3 lore raw
In reply to Thorsten Blum

Hi Thorsten,

Thanks for your patch!

Quoted 1 line · Thorsten Blum

[PATCH v2] m68k: amiga: Mark amiga_reset() as __noreturn

This is not what this patch does, as amiga_reset() is already marked __noreturn.

Quoted 2 lines

Mark both the forward declaration and the function definition as __noreturn, and remove the redundant redeclaration.

Why both? No other static function (except for xen_pv_play_dead) is tagged __noreturn in both the forward declaration and the implementation.

Quoted 14 lines
arch/m68k/amiga/config.c +1 -1
@@ -96,7 +96,7 @@ static char amiga_model_name[13] = "Amiga ";
 static void amiga_sched_init(void);
 static void amiga_get_model(char *model);
 static void amiga_get_hardware_list(struct seq_file *m);
-static void amiga_reset(void);
+static void __noreturn amiga_reset(void);
 static void amiga_mem_console_write(struct console *co, const char *b,
                                    unsigned int count);
 #ifdef CONFIG_HEARTBEAT

arch/m68k/amiga/config.c static u64 amiga_read_clk(struct clocksource *cs) · line 549

Quoted 10 lines
arch/m68k/amiga/config.c +1 -3
@@ -543,9 +543,7 @@ static u64 amiga_read_clk(struct clocksource *cs)
        return ticks;
 }
 
-static void amiga_reset(void)  __noreturn;
-
-static void amiga_reset(void)
+static void __noreturn amiga_reset(void)
 {
        unsigned long jmp_addr040 = virt_to_phys(&&jmp_addr_label040);
        unsigned long jmp_addr = virt_to_phys(&&jmp_addr_label);

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
#4 lore raw
Quoted 9 lines · Geert Uytterhoeven

Hi Thorsten,

Thanks for your patch!

Quoted 1 line · Thorsten Blum

[PATCH v2] m68k: amiga: Mark amiga_reset() as __noreturn

This is not what this patch does, as amiga_reset() is already marked __noreturn.

I assumed __noreturn on the second prototype would be ignored, but it is in fact additive.

Quoted 6 lines
Quoted 2 lines

Mark both the forward declaration and the function definition as __noreturn, and remove the redundant redeclaration.

Why both? No other static function (except for xen_pv_play_dead) is tagged __noreturn in both the forward declaration and the implementation.

Can I blame the heat wave?

I'll send a v3 later.

Thanks,
Thorsten