mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/3] MIPS: DEC: Fix missing platform prototypes
@ 2026-05-04 20:13 Maciej W. Rozycki
  2026-05-04 20:13 ` [PATCH 1/3] MIPS: Make do_IRQ() available for assembly callers Maciej W. Rozycki
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Maciej W. Rozycki @ 2026-05-04 20:13 UTC (permalink / raw)
  To: Thomas Bogendoerfer; +Cc: linux-mips, linux-kernel

Hi,

 This set of patches fixes an issue with warnings issued by more recent 
compilers for a bunch of platform functions that are missing prototypes.  
Split into three changes for self-containment.  Please apply.

  Maciej

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

* [PATCH 1/3] MIPS: Make do_IRQ() available for assembly callers
  2026-05-04 20:13 [PATCH 0/3] MIPS: DEC: Fix missing platform prototypes Maciej W. Rozycki
@ 2026-05-04 20:13 ` Maciej W. Rozycki
  2026-05-04 20:14 ` [PATCH 2/3] MIPS: DEC: Remove do_IRQ() call indirection Maciej W. Rozycki
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Maciej W. Rozycki @ 2026-05-04 20:13 UTC (permalink / raw)
  To: Thomas Bogendoerfer; +Cc: linux-mips, linux-kernel

As from commit 8f99a1626535 ("MIPS: Tracing: Add IRQENTRY_EXIT section 
for MIPS") do_IRQ() is not a macro anymore and can be invoked directly 
from assembly code again, however its `asmlinkage' annotation has never 
been brought back from the previous removal of the function with commit 
187933f23679 ("[MIPS] do_IRQ cleanup").

Since calling the function directly from assembly code has a performance 
advantage, add the annotation back so that the DEC platform can make use 
of this again.

Signed-off-by: Maciej W. Rozycki <macro@orcam.me.uk>
---
 arch/mips/include/asm/irq.h |    2 +-
 arch/mips/kernel/irq.c      |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

linux-mips-do-irq-asmlinkage.diff
Index: linux-macro/arch/mips/include/asm/irq.h
===================================================================
--- linux-macro.orig/arch/mips/include/asm/irq.h
+++ linux-macro/arch/mips/include/asm/irq.h
@@ -54,7 +54,7 @@ static inline int irq_canonicalize(int i
 
 asmlinkage void plat_irq_dispatch(void);
 
-extern void do_IRQ(unsigned int irq);
+asmlinkage void do_IRQ(unsigned int irq);
 
 struct irq_domain;
 extern void do_domain_IRQ(struct irq_domain *domain, unsigned int irq);
Index: linux-macro/arch/mips/kernel/irq.c
===================================================================
--- linux-macro.orig/arch/mips/kernel/irq.c
+++ linux-macro/arch/mips/kernel/irq.c
@@ -100,7 +100,7 @@ static inline void check_stack_overflow(
  * SMP cross-CPU interrupts have their own specific
  * handlers).
  */
-void __irq_entry do_IRQ(unsigned int irq)
+asmlinkage void __irq_entry do_IRQ(unsigned int irq)
 {
 	irq_enter();
 	check_stack_overflow();

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

* [PATCH 2/3] MIPS: DEC: Remove do_IRQ() call indirection
  2026-05-04 20:13 [PATCH 0/3] MIPS: DEC: Fix missing platform prototypes Maciej W. Rozycki
  2026-05-04 20:13 ` [PATCH 1/3] MIPS: Make do_IRQ() available for assembly callers Maciej W. Rozycki
@ 2026-05-04 20:14 ` Maciej W. Rozycki
  2026-05-04 20:14 ` [PATCH 3/3] MIPS: DEC: Fix prototypes for halt/reset handlers Maciej W. Rozycki
  2026-05-26 14:44 ` [PATCH 0/3] MIPS: DEC: Fix missing platform prototypes Thomas Bogendoerfer
  3 siblings, 0 replies; 5+ messages in thread
From: Maciej W. Rozycki @ 2026-05-04 20:14 UTC (permalink / raw)
  To: Thomas Bogendoerfer; +Cc: linux-mips, linux-kernel

As from commit 8f99a1626535 ("MIPS: Tracing: Add IRQENTRY_EXIT section 
for MIPS") do_IRQ() is not a macro anymore and can be invoked directly 
from assembly code, as a tail call.  Remove the dec_irq_dispatch() stub 
then and the indirection previously introduced with commit 187933f23679 
("[MIPS] do_IRQ cleanup"), improving performance by reducing the number 
of control flow changes and the overall instruction count, while fixing 
a compiler's complaint about a missing prototype for said stub:

arch/mips/dec/setup.c:780:25: warning: no previous prototype for 'dec_irq_dispatch' [-Wmissing-prototypes]
  780 | asmlinkage unsigned int dec_irq_dispatch(unsigned int irq)
      |                         ^~~~~~~~~~~~~~~~

(which gets promoted to a compilation error with CONFIG_WERROR).

Fixes: 8f99a1626535 ("MIPS: Tracing: Add IRQENTRY_EXIT section for MIPS")
Signed-off-by: Maciej W. Rozycki <macro@orcam.me.uk>
---
 arch/mips/dec/int-handler.S |    2 +-
 arch/mips/dec/setup.c       |    6 ------
 2 files changed, 1 insertion(+), 7 deletions(-)

linux-mips-dec-do-irq.diff
Index: linux-macro/arch/mips/dec/int-handler.S
===================================================================
--- linux-macro.orig/arch/mips/dec/int-handler.S
+++ linux-macro/arch/mips/dec/int-handler.S
@@ -277,7 +277,7 @@
 		 srlv	t3,t1,t2
 
 handle_it:
-		j	dec_irq_dispatch
+		j	do_IRQ
 		 nop
 
 #if defined(CONFIG_32BIT) && defined(CONFIG_MIPS_FP_SUPPORT)
Index: linux-macro/arch/mips/dec/setup.c
===================================================================
--- linux-macro.orig/arch/mips/dec/setup.c
+++ linux-macro/arch/mips/dec/setup.c
@@ -776,9 +776,3 @@ void __init arch_init_irq(void)
 			pr_err("Failed to register halt interrupt\n");
 	}
 }
-
-asmlinkage unsigned int dec_irq_dispatch(unsigned int irq)
-{
-	do_IRQ(irq);
-	return 0;
-}

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

* [PATCH 3/3] MIPS: DEC: Fix prototypes for halt/reset handlers
  2026-05-04 20:13 [PATCH 0/3] MIPS: DEC: Fix missing platform prototypes Maciej W. Rozycki
  2026-05-04 20:13 ` [PATCH 1/3] MIPS: Make do_IRQ() available for assembly callers Maciej W. Rozycki
  2026-05-04 20:14 ` [PATCH 2/3] MIPS: DEC: Remove do_IRQ() call indirection Maciej W. Rozycki
@ 2026-05-04 20:14 ` Maciej W. Rozycki
  2026-05-26 14:44 ` [PATCH 0/3] MIPS: DEC: Fix missing platform prototypes Thomas Bogendoerfer
  3 siblings, 0 replies; 5+ messages in thread
From: Maciej W. Rozycki @ 2026-05-04 20:14 UTC (permalink / raw)
  To: Thomas Bogendoerfer; +Cc: linux-mips, linux-kernel

Remove a bunch of compilation warnings for halt/reset handlers:

arch/mips/dec/reset.c:22:17: warning: no previous prototype for 'dec_machine_restart' [-Wmissing-prototypes]
   22 | void __noreturn dec_machine_restart(char *command)
      |                 ^~~~~~~~~~~~~~~~~~~
arch/mips/dec/reset.c:27:17: warning: no previous prototype for 'dec_machine_halt' [-Wmissing-prototypes]
   27 | void __noreturn dec_machine_halt(void)
      |                 ^~~~~~~~~~~~~~~~
arch/mips/dec/reset.c:32:17: warning: no previous prototype for 'dec_machine_power_off' [-Wmissing-prototypes]
   32 | void __noreturn dec_machine_power_off(void)
      |                 ^~~~~~~~~~~~~~~~~~~~~
arch/mips/dec/reset.c:38:13: warning: no previous prototype for 'dec_intr_halt'
[-Wmissing-prototypes]
   38 | irqreturn_t dec_intr_halt(int irq, void *dev_id)
      |             ^~~~~~~~~~~~~

(which get promoted to compilation errors with CONFIG_WERROR), by moving 
the local prototypes from arch/mips/dec/setup.c to a dedicated header 
for arch/mips/dec/reset.c to use as well.  No functional change.

Signed-off-by: Maciej W. Rozycki <macro@orcam.me.uk>
---
 arch/mips/dec/reset.c             |    2 ++
 arch/mips/dec/setup.c             |    6 +-----
 arch/mips/include/asm/dec/reset.h |   19 +++++++++++++++++++
 3 files changed, 22 insertions(+), 5 deletions(-)

linux-mips-dec-reset.diff
Index: linux-macro/arch/mips/dec/reset.c
===================================================================
--- linux-macro.orig/arch/mips/dec/reset.c
+++ linux-macro/arch/mips/dec/reset.c
@@ -10,6 +10,8 @@
 
 #include <asm/addrspace.h>
 
+#include <asm/dec/reset.h>
+
 typedef void __noreturn (* noret_func_t)(void);
 
 static inline void __noreturn back_to_prom(void)
Index: linux-macro/arch/mips/dec/setup.c
===================================================================
--- linux-macro.orig/arch/mips/dec/setup.c
+++ linux-macro/arch/mips/dec/setup.c
@@ -48,14 +48,10 @@
 #include <asm/dec/kn02ca.h>
 #include <asm/dec/kn03.h>
 #include <asm/dec/kn230.h>
+#include <asm/dec/reset.h>
 #include <asm/dec/system.h>
 
 
-extern void dec_machine_restart(char *command);
-extern void dec_machine_halt(void);
-extern void dec_machine_power_off(void);
-extern irqreturn_t dec_intr_halt(int irq, void *dev_id);
-
 unsigned long dec_kn_slot_base, dec_kn_slot_size;
 
 EXPORT_SYMBOL(dec_kn_slot_base);
Index: linux-macro/arch/mips/include/asm/dec/reset.h
===================================================================
--- /dev/null
+++ linux-macro/arch/mips/include/asm/dec/reset.h
@@ -0,0 +1,19 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+/*
+ *	arch/mips/include/asm/dec/reset.h
+ *
+ *	DECstation/DECsystem halt/reset support.
+ *
+ *	Copyright (C) 2026  Maciej W. Rozycki
+ */
+#ifndef __ASM_DEC_RESET_H
+#define __ASM_DEC_RESET_H
+
+#include <linux/compiler_attributes.h>
+
+void __noreturn dec_machine_restart(char *command);
+void __noreturn dec_machine_halt(void);
+void __noreturn dec_machine_power_off(void);
+irqreturn_t dec_intr_halt(int irq, void *dev_id);
+
+#endif /* __ASM_DEC_RESET_H */

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

* Re: [PATCH 0/3] MIPS: DEC: Fix missing platform prototypes
  2026-05-04 20:13 [PATCH 0/3] MIPS: DEC: Fix missing platform prototypes Maciej W. Rozycki
                   ` (2 preceding siblings ...)
  2026-05-04 20:14 ` [PATCH 3/3] MIPS: DEC: Fix prototypes for halt/reset handlers Maciej W. Rozycki
@ 2026-05-26 14:44 ` Thomas Bogendoerfer
  3 siblings, 0 replies; 5+ messages in thread
From: Thomas Bogendoerfer @ 2026-05-26 14:44 UTC (permalink / raw)
  To: Maciej W. Rozycki; +Cc: linux-mips, linux-kernel

On Mon, May 04, 2026 at 09:13:51PM +0100, Maciej W. Rozycki wrote:
> Hi,
> 
>  This set of patches fixes an issue with warnings issued by more recent 
> compilers for a bunch of platform functions that are missing prototypes.  
> Split into three changes for self-containment.  Please apply.

series applied to mips-next

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]

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

end of thread, other threads:[~2026-05-26 14:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-04 20:13 [PATCH 0/3] MIPS: DEC: Fix missing platform prototypes Maciej W. Rozycki
2026-05-04 20:13 ` [PATCH 1/3] MIPS: Make do_IRQ() available for assembly callers Maciej W. Rozycki
2026-05-04 20:14 ` [PATCH 2/3] MIPS: DEC: Remove do_IRQ() call indirection Maciej W. Rozycki
2026-05-04 20:14 ` [PATCH 3/3] MIPS: DEC: Fix prototypes for halt/reset handlers Maciej W. Rozycki
2026-05-26 14:44 ` [PATCH 0/3] MIPS: DEC: Fix missing platform prototypes Thomas Bogendoerfer

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

all inboxes | Powered by JetHome®