lkml.org 
[lkml]   [2020]   [Oct]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] irqdomain: fix -Wshadow warning
Date
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
\
 
 \ /
  Last update: 2020-10-26 17:20    [W:0.072 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site