From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DDCFDC55179 for ; Wed, 28 Oct 2020 22:08:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8C28F246C5 for ; Wed, 28 Oct 2020 22:08:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730175AbgJ1WIC (ORCPT ); Wed, 28 Oct 2020 18:08:02 -0400 Received: from mga11.intel.com ([192.55.52.93]:9420 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730357AbgJ1WHy (ORCPT ); Wed, 28 Oct 2020 18:07:54 -0400 IronPort-SDR: 40FHPcWqQj1zxW/9cQqRsalTkTN8+904YEC5PXmBkLXB00Ob4qcHRmK1QaHzHqiKw7hzTkifXK H3lQQaixz6sQ== X-IronPort-AV: E=McAfee;i="6000,8403,9788"; a="164795977" X-IronPort-AV: E=Sophos;i="5.77,427,1596524400"; d="scan'208";a="164795977" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Oct 2020 10:04:33 -0700 IronPort-SDR: Wk+cwQAX4UPPu1+Li/FegkOVOmBdRomPZlJPiY7KK86Ir7CYzhZssJFvA7qlf0OpQ6e3vs4Slo YNNYDIsRR5Eg== X-IronPort-AV: E=Sophos;i="5.77,427,1596524400"; d="scan'208";a="351078828" Received: from sjchrist-coffee.jf.intel.com (HELO linux.intel.com) ([10.54.74.160]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Oct 2020 10:04:33 -0700 Date: Wed, 28 Oct 2020 10:04:32 -0700 From: Sean Christopherson To: Arnd Bergmann Cc: Paolo Bonzini , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, Arnd Bergmann , Gleb Natapov , Avi Kivity , Ingo Molnar , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , "H. Peter Anvin" , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] x86: kvm: avoid -Wshadow warning in header Message-ID: <20201028170430.GC7584@linux.intel.com> References: <20201026161512.3708919-1-arnd@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201026161512.3708919-1-arnd@kernel.org> User-Agent: Mutt/1.5.24 (2015-08-30) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 26, 2020 at 05:14:39PM +0100, Arnd Bergmann wrote: > From: Arnd Bergmann > > 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.