lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAK8P3a28R9k2xt-=EDACpY1_WKP0BBU4E08H6AAOnx-eHV2Prg@mail.gmail.com>
Date:   Wed, 28 Oct 2020 19:31:30 +0100
From:   Arnd Bergmann <arnd@...nel.org>
To:     Sean Christopherson <sean.j.christopherson@...el.com>
Cc:     Paolo Bonzini <pbonzini@...hat.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
        "the arch/x86 maintainers" <x86@...nel.org>,
        Arnd Bergmann <arnd@...db.de>, Gleb Natapov <gleb@...hat.com>,
        Avi Kivity <avi@...hat.com>, Ingo Molnar <mingo@...e.hu>,
        Vitaly Kuznetsov <vkuznets@...hat.com>,
        Wanpeng Li <wanpengli@...cent.com>,
        Jim Mattson <jmattson@...gle.com>,
        Joerg Roedel <joro@...tes.org>,
        "H. Peter Anvin" <hpa@...or.com>, kvm list <kvm@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] x86: kvm: avoid -Wshadow warning in header

On Wed, Oct 28, 2020 at 6:04 PM Sean Christopherson
<sean.j.christopherson@...el.com> wrote:
>
> On Mon, Oct 26, 2020 at 05:14:39PM +0100, Arnd Bergmann wrote:
> > From: Arnd Bergmann <arnd@...db.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.

Yes, good point. I'll send a new patch for it later. Any suggestion
for a better name?

     Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ