[PATCH] arm: avoid cpumask_t typedef in arch_trigger_cpumask_backtrace

From: Rasmus Villemoes
Date: Thu Nov 21 2019 - 04:25:23 EST


I was trying to enable a previously PPC-only driver for ARM. That
driver happens to include asm/irq.h without some previous header
recursively pulling in linux/cpumask.h, resulting in kbuild kindly
informing me [1]

In file included from drivers/soc/fsl/qe/ucc.c:18:0:
>> arch/arm/include/asm/irq.h:34:50: error: unknown type name 'cpumask_t'
extern void arch_trigger_cpumask_backtrace(const cpumask_t *mask,

Instead of including linux/cpumask.h from asm/irq.h just for the
cpumask_t typedef, use the spelling "struct cpumask" and add a
forward declaration of that. For consistency, update the definition of
the function accordingly.

No functional change.

[1] https://lore.kernel.org/lkml/201911210258.dfd8HF9z%25lkp@xxxxxxxxx/

Reported-by: kbuild test robot <lkp@xxxxxxxxx>
Signed-off-by: Rasmus Villemoes <linux@xxxxxxxxxxxxxxxxxx>
---
We're past -rc8, so I probably can't hope for this to make it into
5.4. However, it currently blocks a rather large series of mine from
being picked up and getting time in -next. Would it be ok with the ARM
maintainers if I ask Li Yang to carry this as part of that large
series?

arch/arm/include/asm/irq.h | 3 ++-
arch/arm/kernel/smp.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/arm/include/asm/irq.h b/arch/arm/include/asm/irq.h
index 46d41140df27..d8deb81bc8ce 100644
--- a/arch/arm/include/asm/irq.h
+++ b/arch/arm/include/asm/irq.h
@@ -31,7 +31,8 @@ void handle_IRQ(unsigned int, struct pt_regs *);
void init_IRQ(void);

#ifdef CONFIG_SMP
-extern void arch_trigger_cpumask_backtrace(const cpumask_t *mask,
+struct cpumask;
+extern void arch_trigger_cpumask_backtrace(const struct cpumask *mask,
bool exclude_self);
#define arch_trigger_cpumask_backtrace arch_trigger_cpumask_backtrace
#endif
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index 4b0bab2607e4..b096200c7436 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -806,7 +806,8 @@ static void raise_nmi(cpumask_t *mask)
__smp_cross_call(mask, IPI_CPU_BACKTRACE);
}

-void arch_trigger_cpumask_backtrace(const cpumask_t *mask, bool exclude_self)
+void arch_trigger_cpumask_backtrace(const struct cpumask *mask,
+ bool exclude_self)
{
nmi_trigger_cpumask_backtrace(mask, exclude_self, raise_nmi);
}
--
2.23.0