[PATCH] x86/irq: fix [-Wvisibility] warnings

From: Tudor Ambarus
Date: Tue Jan 09 2024 - 09:11:00 EST


Sorting include entries in alphabetical order for
drivers/tty/serial/samsung_tty.c revealed the following warnings:

In file included from drivers/tty/serial/samsung_tty.c:24:
>> arch/x86/include/asm/irq.h:39:56: warning: declaration of 'struct pt_regs' will not be visible outside of this function [-Wvisibility]
39 | extern void __handle_irq(struct irq_desc *desc, struct pt_regs *regs);
| ^
>> arch/x86/include/asm/irq.h:44:50: warning: declaration of 'struct cpumask' will not be visible outside of this function [-Wvisibility]
44 | void arch_trigger_cpumask_backtrace(const struct cpumask *mask,
| ^
2 warnings generated.

Fix them by including <linux/cpumask.h> and by adding a forward
declaration for ``struct pt_regs``.

Reported-by: kernel test robot <lkp@xxxxxxxxx>
Closes: https://lore.kernel.org/oe-kbuild-all/202401090827.6Qt43Hqk-lkp@xxxxxxxxx/
Signed-off-by: Tudor Ambarus <tudor.ambarus@xxxxxxxxxx>
---
arch/x86/include/asm/irq.h | 3 +++
1 file changed, 3 insertions(+)

diff --git a/arch/x86/include/asm/irq.h b/arch/x86/include/asm/irq.h
index 836c170d3087..4b689cec473e 100644
--- a/arch/x86/include/asm/irq.h
+++ b/arch/x86/include/asm/irq.h
@@ -10,6 +10,7 @@

#include <asm/apicdef.h>
#include <asm/irq_vectors.h>
+#include <linux/cpumask.h>

/*
* The irq entry code is in the noinstr section and the start/end of
@@ -36,6 +37,8 @@ extern void kvm_set_posted_intr_wakeup_handler(void (*handler)(void));
extern void (*x86_platform_ipi_callback)(void);
extern void native_init_IRQ(void);

+struct pt_regs;
+
extern void __handle_irq(struct irq_desc *desc, struct pt_regs *regs);

extern void init_ISA_irqs(void);
--
2.43.0.472.g3155946c3a-goog