m68k: amiga: Mark amiga_reset() as __noreturn
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
@@ -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);
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
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.releaseUPD 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