All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] m68k: amiga: Mark amiga_reset() as __noreturn
@ 2026-06-26 14:57 Thorsten Blum
  2026-06-26 15:07 ` Daniel Palmer
  2026-06-29  7:25 ` Geert Uytterhoeven
  0 siblings, 2 replies; 5+ messages in thread
From: Thorsten Blum @ 2026-06-26 14:57 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Daniel Palmer, 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>
---
Changes in v2:
- Specify the __noreturn attribute before the function name to avoid a
  compile-time error (Daniel)
- v1: https://lore.kernel.org/r/20260626104142.3782-2-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 __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);

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

* Re: [PATCH v2] m68k: amiga: Mark amiga_reset() as __noreturn
  2026-06-26 14:57 [PATCH v2] m68k: amiga: Mark amiga_reset() as __noreturn Thorsten Blum
@ 2026-06-26 15:07 ` Daniel Palmer
  2026-06-26 15:12   ` Thorsten Blum
  2026-06-29  7:25 ` Geert Uytterhoeven
  1 sibling, 1 reply; 5+ messages in thread
From: Daniel Palmer @ 2026-06-26 15:07 UTC (permalink / raw)
  To: Thorsten Blum; +Cc: Geert Uytterhoeven, linux-m68k, linux-kernel

Hi Thorsten,

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

Tested-by: Daniel Palmer <daniel@thingy.jp>

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

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

On Sat, Jun 27, 2026 at 12:07:30AM +0900, Daniel Palmer wrote:
> Hi Thorsten,
> 
> On Fri, 26 Jun 2026 at 23:58, Thorsten Blum <thorsten.blum@linux.dev> wrote:
> >
> > 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:
> 
> Tested-by: Daniel Palmer <daniel@thingy.jp>

Thank you!

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

* Re: [PATCH v2] m68k: amiga: Mark amiga_reset() as __noreturn
  2026-06-26 14:57 [PATCH v2] m68k: amiga: Mark amiga_reset() as __noreturn Thorsten Blum
  2026-06-26 15:07 ` Daniel Palmer
@ 2026-06-29  7:25 ` Geert Uytterhoeven
  2026-06-29  8:55   ` Thorsten Blum
  1 sibling, 1 reply; 5+ messages in thread
From: Geert Uytterhoeven @ 2026-06-29  7:25 UTC (permalink / raw)
  To: Thorsten Blum; +Cc: Daniel Palmer, linux-m68k, linux-kernel

Hi Thorsten,

Thanks for your patch!

On Fri, 26 Jun 2026 at 16:58, Thorsten Blum <thorsten.blum@linux.dev> wrote:
> [PATCH v2] m68k: amiga: Mark amiga_reset() as __noreturn

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

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

> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>

> --- 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 __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);

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

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

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

* Re: [PATCH v2] m68k: amiga: Mark amiga_reset() as __noreturn
  2026-06-29  7:25 ` Geert Uytterhoeven
@ 2026-06-29  8:55   ` Thorsten Blum
  0 siblings, 0 replies; 5+ messages in thread
From: Thorsten Blum @ 2026-06-29  8:55 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Daniel Palmer, linux-m68k, linux-kernel

On Mon, Jun 29, 2026 at 09:25:48AM +0200, Geert Uytterhoeven wrote:
> Hi Thorsten,
> 
> Thanks for your patch!
> 
> On Fri, 26 Jun 2026 at 16:58, Thorsten Blum <thorsten.blum@linux.dev> wrote:
> > [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.

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

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

end of thread, other threads:[~2026-06-29  8:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-26 14:57 [PATCH v2] m68k: amiga: Mark amiga_reset() as __noreturn Thorsten Blum
2026-06-26 15:07 ` Daniel Palmer
2026-06-26 15:12   ` Thorsten Blum
2026-06-29  7:25 ` Geert Uytterhoeven
2026-06-29  8:55   ` Thorsten Blum

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.