mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] irqdomain: fix -Wshadow warning
@ 2020-10-26 16:20 Arnd Bergmann
  2020-11-16 14:03 ` Thomas Gleixner
  0 siblings, 1 reply; 4+ messages in thread
From: Arnd Bergmann @ 2020-10-26 16:20 UTC (permalink / raw)
  To: Marc Zyngier; +Cc: Arnd Bergmann, Thomas Gleixner, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

When building with W=2, there are tons of warnings about conflicting
local and global definitions of 'nr_irqs' in common header files:

include/linux/irqdomain.h: In function 'irq_domain_alloc_irqs':
include/linux/irqdomain.h:482:17: warning: declaration of 'nr_irqs' shadows a global declaration [-Wshadow]
  482 |    unsigned int nr_irqs, int node, void *arg)
      |    ~~~~~~~~~~~~~^~~~~~~
In file included from ../include/linux/interrupt.h:10,
                 from ../include/linux/kernel_stat.h:9,
                 from ../include/linux/cgroup.h:26,
                 from ../include/linux/perf_event.h:57,
                 from ../include/linux/trace_events.h:10,
                 from ../include/trace/syscall.h:7,
                 from ../include/linux/syscalls.h:84,
                 from ../init/main.c:21:
include/linux/irqnr.h:8:12: note: shadowed declaration is here
    8 | extern int nr_irqs;
      |            ^~~~~~~

Rename the local in irqdomain.h to shut up those warnings

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 include/linux/irqdomain.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h
index 71535e87109f..3942f456f616 100644
--- a/include/linux/irqdomain.h
+++ b/include/linux/irqdomain.h
@@ -479,9 +479,9 @@ extern int irq_domain_activate_irq(struct irq_data *irq_data, bool early);
 extern void irq_domain_deactivate_irq(struct irq_data *irq_data);
 
 static inline int irq_domain_alloc_irqs(struct irq_domain *domain,
-			unsigned int nr_irqs, int node, void *arg)
+			unsigned int num_irqs, int node, void *arg)
 {
-	return __irq_domain_alloc_irqs(domain, -1, nr_irqs, node, arg, false,
+	return __irq_domain_alloc_irqs(domain, -1, num_irqs, node, arg, false,
 				       NULL);
 }
 
-- 
2.27.0


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

end of thread, other threads:[~2020-11-16 17:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-26 16:20 [PATCH] irqdomain: fix -Wshadow warning Arnd Bergmann
2020-11-16 14:03 ` Thomas Gleixner
2020-11-16 15:26   ` Arnd Bergmann
2020-11-16 17:28     ` Thomas Gleixner

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

Powered by JetHome