From: Sean Christopherson <sean.j.christopherson@intel.com>
To: Arnd Bergmann <arnd@kernel.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
x86@kernel.org, Arnd Bergmann <arnd@arndb.de>,
Gleb Natapov <gleb@redhat.com>, Avi Kivity <avi@redhat.com>,
Ingo Molnar <mingo@elte.hu>,
Vitaly Kuznetsov <vkuznets@redhat.com>,
Wanpeng Li <wanpengli@tencent.com>,
Jim Mattson <jmattson@google.com>, Joerg Roedel <joro@8bytes.org>,
"H. Peter Anvin" <hpa@zytor.com>,
kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86: kvm: avoid -Wshadow warning in header
Date: Wed, 28 Oct 2020 10:04:32 -0700 [thread overview]
Message-ID: <20201028170430.GC7584@linux.intel.com> (raw)
In-Reply-To: <20201026161512.3708919-1-arnd@kernel.org>
On Mon, Oct 26, 2020 at 05:14:39PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> There are hundreds of warnings in a W=2 build about a local
> variable shadowing the global 'apic' definition:
>
> arch/x86/kvm/lapic.h:149:65: warning: declaration of 'apic' shadows a global declaration [-Wshadow]
>
> Avoid this by renaming the local in the kvm/lapic.h header
Rather than change KVM, and presumably other files as well, e.g. kvm/lapic.c and
apic/io_apic.c also shadow 'apic' all over the place, what about renaming the
global 'apic' to something more unique? KVM aside, using such a common name for
a global variable has always struck me as a bit odd/dangerous/confusing.
next prev parent reply other threads:[~2020-10-28 22:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-26 16:14 [PATCH] x86: kvm: avoid -Wshadow warning in header Arnd Bergmann
2020-10-28 17:04 ` Sean Christopherson [this message]
2020-10-28 18:31 ` Arnd Bergmann
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=20201028170430.GC7584@linux.intel.com \
--to=sean.j.christopherson@intel.com \
--cc=arnd@arndb.de \
--cc=arnd@kernel.org \
--cc=avi@redhat.com \
--cc=bp@alien8.de \
--cc=gleb@redhat.com \
--cc=hpa@zytor.com \
--cc=jmattson@google.com \
--cc=joro@8bytes.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mingo@redhat.com \
--cc=pbonzini@redhat.com \
--cc=tglx@linutronix.de \
--cc=vkuznets@redhat.com \
--cc=wanpengli@tencent.com \
--cc=x86@kernel.org \
/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