linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@kernel.org>
To: Marc Zyngier <maz@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	linux-kernel@vger.kernel.org
Subject: [PATCH] irqdomain: fix -Wshadow warning
Date: Mon, 26 Oct 2020 17:20:05 +0100	[thread overview]
Message-ID: <20201026162022.3710091-1-arnd@kernel.org> (raw)

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


             reply	other threads:[~2020-10-26 16:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-26 16:20 Arnd Bergmann [this message]
2020-11-16 14:03 ` [PATCH] irqdomain: fix -Wshadow warning Thomas Gleixner
2020-11-16 15:26   ` Arnd Bergmann
2020-11-16 17:28     ` Thomas Gleixner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201026162022.3710091-1-arnd@kernel.org \
    --to=arnd@kernel.org \
    --cc=arnd@arndb.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).