Skip to contentSkip to conversation

m68k: amiga: Mark amiga_reset() as __noreturn

PATCH Superseded Thorsten Blum 2 participants 3 messages Jun 26 m68k architecture

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 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.

---
 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 amiga_reset(void) __noreturn;
 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 amiga_reset(void) __noreturn
 {
 	unsigned long jmp_addr040 = virt_to_phys(&&jmp_addr_label040);
 	unsigned long jmp_addr = virt_to_phys(&&jmp_addr_label);
#1 lore raw

Hi Thorsten,

Quoted 4 lines · Thorsten Blum

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

<snip>

I tried to build and boot test this on my Amiga 4000 but the build is borken:

UPD include/config/kernel.release

 UPD     include/generated/utsrelease.h
 CC      init/version.o
 AR      init/built-in.a
 CC      arch/m68k/amiga/config.o
arch/m68k/amiga/config.c:546:1: error: attributes should be specified
before the declarator in a function definition
 546 | static void amiga_reset(void) __noreturn
     | ^~~~~~
arch/m68k/amiga/config.c:99:13: warning: ‘amiga_reset’ used but never defined
  99 | static void amiga_reset(void) __noreturn;
     |             ^~~~~~~~~~~

GCC version is: m68k-linux-gnu-gcc (Debian 15.2.0-17) 15.2.0

Cheers,

Daniel

#2 lore raw

Hi Daniel,

Quoted 24 lines · Daniel Palmer

Hi Thorsten,

Quoted 4 lines · Thorsten Blum

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

<snip>

I tried to build and boot test this on my Amiga 4000 but the build is borken:

UPD include/config/kernel.release

 UPD     include/generated/utsrelease.h
 CC      init/version.o
 AR      init/built-in.a
 CC      arch/m68k/amiga/config.o
arch/m68k/amiga/config.c:546:1: error: attributes should be specified
before the declarator in a function definition
 546 | static void amiga_reset(void) __noreturn
     | ^~~~~~
arch/m68k/amiga/config.c:99:13: warning: ‘amiga_reset’ used but never defined
  99 | static void amiga_reset(void) __noreturn;
     |             ^~~~~~~~~~~
Quoted 1 line

GCC version is: m68k-linux-gnu-gcc (Debian 15.2.0-17) 15.2.0

I also compiled it, but then moved the __noreturn to the end which is apparently not allowed. Feel free to try:

	static void __noreturn amiga_reset(void);

That should work. I'll send a v2 later.

Thanks,
Thorsten