Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp627028pxx; Mon, 26 Oct 2020 17:21:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzV8lbzfvrxnB4gHUWHGyZREsGgV2iSj8ywdXH5DOmll+RTA5X4SBasXcrqAdIHJxEKj0Zr X-Received: by 2002:a17:906:f6d8:: with SMTP id jo24mr16449547ejb.173.1603758096199; Mon, 26 Oct 2020 17:21:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603758096; cv=none; d=google.com; s=arc-20160816; b=nm993FwrIPDhbFhIeNKb3NLnckfdR63Mhw08H8oMp6L3iIkEiicD+1ke6kRS4UwSOS rZXkNvairDOXgHTIduxCMhEHNg6xSY7DJaH30loam66h9egefHTAL12ceREAYftvAv4I x/ELhQ8ywBUNOoM6gVeLvHMwjcblFyi++hv8nta7WDUkGZPBaqHqCOAHcKoQvn7/dT5w KyPd3mvt2EnoHzY/sxQ4K+dUZrMS9X5RKr9o3Mmeooloz7Gn2PQJ4zARoNHQd8cSNovV SHSJ8u+a52RWGgcIONhFttgkgRGSpOKGvtFGkjg44SnYqs+UHFHTR5+bpvCoEjzOAX0j wjUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=Nc+LJIctkA2xokS8Hjft6K+F5HViXFmcJYECMK/0XSs=; b=k5aD3e6sk1Rk/D9BxhNcqDGY5tPyVQ5x9Ryjto2i0Tr/q7DlHvsvcsb7PKUyG1qxZV q51prJlmkqzSs1yIVWBOVus+gisPgzv8XN9MsaWzhBcQ+DNq0lQbEf2xcc0Zq0csOGvy 3pt4eUpgr2jH52wPj0j80Iqqu8kgA80abuyD3gpKokSyMYq/WiXkJz9KcaXzBifUmtKE 6Wpt/to1oj9BZTSxBEwQWooELO2nLhQ9odsJdjp1M1QnLFnSjWTtcABJosORF3NiFWcg e0uQI+KGdtZV7TGhHd4musowz9MXFyCl8u4VCHmdXAIbH6iKHCr2u/eJkSWgWLmwzYdx R4mA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f25si8132707eje.196.2020.10.26.17.21.14; Mon, 26 Oct 2020 17:21:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728022AbgJ0AC2 (ORCPT + 99 others); Mon, 26 Oct 2020 20:02:28 -0400 Received: from mail-ua1-f68.google.com ([209.85.222.68]:43477 "EHLO mail-ua1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728509AbgJ0ACY (ORCPT ); Mon, 26 Oct 2020 20:02:24 -0400 Received: by mail-ua1-f68.google.com with SMTP id r21so3428151uaw.10; Mon, 26 Oct 2020 17:02:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Nc+LJIctkA2xokS8Hjft6K+F5HViXFmcJYECMK/0XSs=; b=OQJ8kzN4C8CFDTkcCh2rA49sg4uUmOh9V4Korw02JjNdE/cPq08xUFfaA8odbE+NMx tRuUn5bIJqDfUkoI3z6x+FzIJoAMUxD9EnTX14oCiLAOiNKLVKDrAqpUm+BzPy81a6+7 JrCM3k/4L21kBlJ+Ybi2JVcDhV/jf5E/xcCblqNXsd00EN2Ak1SKFD1Xf/YHPPdTKhfF 8zInTDMN9D9Ukek5LjPXoz88wj3NbBEFTAB4vedi9S9pAxvgaYqqIwdzOQ1mu6nYRY+H edvEBa09ronjKBMHU9qkZ7fAMFaFksVZ4X5YzHa4acETkIVPuN5JNpqdONe+rFBKZkhh wgKg== X-Gm-Message-State: AOAM5332Vyl6zd4zjaSQU53d0ayl0EBE6mwc6NA2aBPjtFEkkSIFbHoy 97JGltuXyqKGyPHyCMQwDCA= X-Received: by 2002:ab0:6f81:: with SMTP id f1mr23600098uav.31.1603756943628; Mon, 26 Oct 2020 17:02:23 -0700 (PDT) Received: from google.com (239.145.196.35.bc.googleusercontent.com. [35.196.145.239]) by smtp.gmail.com with ESMTPSA id f195sm374846vka.21.2020.10.26.17.02.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Oct 2020 17:02:22 -0700 (PDT) Date: Tue, 27 Oct 2020 00:02:21 +0000 From: Dennis Zhou To: Arnd Bergmann Cc: Arnd Bergmann , Christoph Lameter , Luc Van Oostenryck , linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] asm-generic: percpu: avoid Wshadow warning Message-ID: <20201027000221.GA3804841@google.com> References: <20201026155353.3702892-1-arnd@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201026155353.3702892-1-arnd@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Mon, Oct 26, 2020 at 04:53:48PM +0100, Arnd Bergmann wrote: > From: Arnd Bergmann > > Nesting macros that use the same local variable names causes > warnings when building with "make W=2": > > include/asm-generic/percpu.h:117:14: warning: declaration of '__ret' shadows a previous local [-Wshadow] > include/asm-generic/percpu.h:126:14: warning: declaration of '__ret' shadows a previous local [-Wshadow] > > These are fairly harmless, but since the warning comes from > a global header, the warning happens every time the headers > are included, which is fairly annoying. > > Rename the variables to avoid shadowing and shut up the warning. > > Signed-off-by: Arnd Bergmann > --- > include/asm-generic/percpu.h | 18 +++++++++--------- > 1 file changed, 9 insertions(+), 9 deletions(-) > > diff --git a/include/asm-generic/percpu.h b/include/asm-generic/percpu.h > index 35e4a53b83e6..6432a7fade91 100644 > --- a/include/asm-generic/percpu.h > +++ b/include/asm-generic/percpu.h > @@ -114,21 +114,21 @@ do { \ > > #define __this_cpu_generic_read_nopreempt(pcp) \ > ({ \ > - typeof(pcp) __ret; \ > + typeof(pcp) ___ret; \ > preempt_disable_notrace(); \ > - __ret = READ_ONCE(*raw_cpu_ptr(&(pcp))); \ > + ___ret = READ_ONCE(*raw_cpu_ptr(&(pcp))); \ > preempt_enable_notrace(); \ > - __ret; \ > + ___ret; \ > }) > > #define __this_cpu_generic_read_noirq(pcp) \ > ({ \ > - typeof(pcp) __ret; \ > - unsigned long __flags; \ > - raw_local_irq_save(__flags); \ > - __ret = raw_cpu_generic_read(pcp); \ > - raw_local_irq_restore(__flags); \ > - __ret; \ > + typeof(pcp) ___ret; \ > + unsigned long ___flags; \ > + raw_local_irq_save(___flags); \ > + ___ret = raw_cpu_generic_read(pcp); \ > + raw_local_irq_restore(___flags); \ > + ___ret; \ > }) > > #define this_cpu_generic_read(pcp) \ > -- > 2.27.0 > I've applied this to percpu#for-5.10-fixes. Thanks, Dennis