The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] m68k: amiga: Mark amiga_reset() as __noreturn
@ 2026-06-26 10:41 Thorsten Blum
  2026-06-26 13:49 ` Daniel Palmer
  0 siblings, 1 reply; 3+ messages in thread
From: Thorsten Blum @ 2026-06-26 10:41 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Thorsten Blum, linux-m68k, linux-kernel

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

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 arch/m68k/amiga/config.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/m68k/amiga/config.c b/arch/m68k/amiga/config.c
index 242d18e750b0..7b72d964577a 100644
--- a/arch/m68k/amiga/config.c
+++ b/arch/m68k/amiga/config.c
@@ -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);

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] m68k: amiga: Mark amiga_reset() as __noreturn
  2026-06-26 10:41 [PATCH] m68k: amiga: Mark amiga_reset() as __noreturn Thorsten Blum
@ 2026-06-26 13:49 ` Daniel Palmer
  2026-06-26 13:57   ` Thorsten Blum
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Palmer @ 2026-06-26 13:49 UTC (permalink / raw)
  To: Thorsten Blum; +Cc: Geert Uytterhoeven, linux-m68k, linux-kernel

Hi Thorsten,

On Fri, 26 Jun 2026 at 19:43, Thorsten Blum <thorsten.blum@linux.dev> wrote:
>
> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] m68k: amiga: Mark amiga_reset() as __noreturn
  2026-06-26 13:49 ` Daniel Palmer
@ 2026-06-26 13:57   ` Thorsten Blum
  0 siblings, 0 replies; 3+ messages in thread
From: Thorsten Blum @ 2026-06-26 13:57 UTC (permalink / raw)
  To: Daniel Palmer; +Cc: Geert Uytterhoeven, linux-m68k, linux-kernel

Hi Daniel,

On Fri, Jun 26, 2026 at 10:49:59PM +0900, Daniel Palmer wrote:
> Hi Thorsten,
> 
> On Fri, 26 Jun 2026 at 19:43, Thorsten Blum <thorsten.blum@linux.dev> wrote:
> >
> > 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

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-06-26 13:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-26 10:41 [PATCH] m68k: amiga: Mark amiga_reset() as __noreturn Thorsten Blum
2026-06-26 13:49 ` Daniel Palmer
2026-06-26 13:57   ` Thorsten Blum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox