Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2143789imm; Thu, 18 Oct 2018 09:41:06 -0700 (PDT) X-Google-Smtp-Source: ACcGV61EIJcqIoTAp/ds299ktfRTVVKPe+hLMQznf4/J8iwN5sPTtEu1yRIuJaYiTCiZODNfpQqf X-Received: by 2002:a63:6c84:: with SMTP id h126-v6mr29188357pgc.237.1539880866488; Thu, 18 Oct 2018 09:41:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539880866; cv=none; d=google.com; s=arc-20160816; b=oPGUpqjzcgvmRFCdzBl+pSQe318j24CSsMtW72d9wN60NYjKPrLfzYkgxlUo6TYief dwpfR2ANSvVUucpvizMBbKY3GmJa7FMvP+7VjKhgrj+vcV2Ptu8qCuaVrtbMTmYus2L8 Srgp2C1/7IrvrzsH4pWX5OJ4Rf9HcofEKx6dR5fTmwCizEN2J4Ez72FoMN69HD6BdP0U VMlwZc/CtAU1BMEuh8yOuUlWXQ8x8Oq1POWmKHqyZhA6BNNir6vW4U+Xktx4wQ4zIOa2 Dg7xMSXGPU9S9ouaJJCDEZx5YH8RsfzYrO7UCUDmkzRs/SaFZ3R4Pwey9nnzkBMHBDny 4EXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature:dkim-filter; bh=pEqnXhckKbCXBfOtdr1rIgOoYc5/TlciIhzPLhBqPvQ=; b=DTHieeidLtip/q62/mexDYPyM4pFvEEFpV0CGK/P97kKyq+UsVJikIeK9fBUJ7oUQn mMlb5twSiSENbAUuAXs7eVOQyLbtCkHcni+DfeoH3viM4MMgdJ9mOo3lq19z0XNuMLwS IKzGqaNbJSZvtSV3PW9DC5VRlxDmD6fkcnmy5F04PSeQE8aR//TURpA0yrMdK2zgjoAv bSjoCYwbpFw3VSvEclf9vK3+osG4mhj6+aWzBnBdZ5UmGsPrxcaTVh5Rwv2dV/m82OFS 73qDosnuUW8Mkk8ZkmZ8OVfETm/Euef8bFzfBuWJX/ahu457vFDZpOnYpxStvlBpPh1I TBvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=Yzrf3qjw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v17-v6si22191656pfg.157.2018.10.18.09.40.50; Thu, 18 Oct 2018 09:41:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=Yzrf3qjw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728348AbeJSAlv (ORCPT + 99 others); Thu, 18 Oct 2018 20:41:51 -0400 Received: from conssluserg-04.nifty.com ([210.131.2.83]:62240 "EHLO conssluserg-04.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727294AbeJSAlv (ORCPT ); Thu, 18 Oct 2018 20:41:51 -0400 Received: from mail-vs1-f47.google.com (mail-vs1-f47.google.com [209.85.217.47]) (authenticated) by conssluserg-04.nifty.com with ESMTP id w9IGdwgB003597; Fri, 19 Oct 2018 01:39:59 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-04.nifty.com w9IGdwgB003597 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1539880799; bh=pEqnXhckKbCXBfOtdr1rIgOoYc5/TlciIhzPLhBqPvQ=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Yzrf3qjwiri4uFX0mhCKeKIfnRxmdDweaIe8kR8Hr5Rr8tqXIE/ao7OpPVJVLvECl iZ2kHXTf7pVGfTr3OFeCYN3GYOy/FdAMpYgZpJPIttn6mDkPqNzymUnKmV16xWrwNq OvedemmL5XHDcelGjs/FF8/AehNriG7nAeM/DpXY642RTDGflwxNRj1Z8DWhIVQ0aL uAToWjCv7c47LMzwGtDsmgPcshk6NuYCimywwKj1hOfD4x8CbJAoxlqA3xODN807PO lZ0VmfxbaFZIB0EQP7If/mu4I73M5YXWeJtKi8tgwuh5rWpwlzfd2L1/wyCi1vFJVB 4ZBym+RppO/5g== X-Nifty-SrcIP: [209.85.217.47] Received: by mail-vs1-f47.google.com with SMTP id y195so7729054vsc.7; Thu, 18 Oct 2018 09:39:58 -0700 (PDT) X-Gm-Message-State: ABuFfojnUqWKXrHKv9V2pIOgW4ZB8WVmbv8CR+9ZRt6C5Y9SchBIsclG wc8UurUonhMCVcrHXYq4N694BuAurMYcr1ZZGWM= X-Received: by 2002:a67:65c3:: with SMTP id z186mr13217613vsb.54.1539880797659; Thu, 18 Oct 2018 09:39:57 -0700 (PDT) MIME-Version: 1.0 References: <20181017000809.GA21292@WindFlash> <20181017081115.GA22535@zn.tnic> <20181017083126.GB22535@zn.tnic> <20181018091606.GA20831@zn.tnic> In-Reply-To: <20181018091606.GA20831@zn.tnic> From: Masahiro Yamada Date: Fri, 19 Oct 2018 01:39:21 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/4] Adds -Wshadow=local on KBUILD_HOSTCFLAGS To: Borislav Petkov Cc: =?UTF-8?Q?Leonardo_Br=C3=A1s?= , lkcamp@lists.libreplanetbr.org, Matthew Wilcox , Andy Lutomirski , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , X86 ML , Michal Marek , Linux Kernel Mailing List , Linux Kbuild mailing list Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 18, 2018 at 6:18 PM Borislav Petkov wrote: > > On Wed, Oct 17, 2018 at 09:40:53PM -0300, Leonardo Bras wrote: > > The idea was to put it as default and fix all the shadowing warnings. > > What do you think? I am open to suggestions. > > That's Masahiro's call. In the rest of the kernel, those warnings are beh= ind > the W=3D2 switch - i.e., not enabled by default. It is not realistic to enable this warning option by default. Even -Wshadow=3Dlocal emits tons of warnings. (More with -Wshadow) The problem of this flag is, it is false positive in macro expansions. For example, I think the following is a legitimate case. In file included from ./arch/arm64/include/asm/cputype.h:126:0, from ./arch/arm64/include/asm/cache.h:19, from ./include/linux/cache.h:6, from ./include/linux/printk.h:9, from ./include/linux/kernel.h:14, from ./include/linux/bitmap.h:10, from arch/arm64/kernel/fpsimd.c:20: arch/arm64/kernel/fpsimd.c: In function =E2=80=98sve_kernel_enable=E2=80=99= : ./arch/arm64/include/asm/sysreg.h:707:6: warning: declaration of =E2=80=98__val=E2=80=99 shadows a previous local [-Wshadow=3Dcompatible-loc= al] u64 __val; \ ^ ./arch/arm64/include/asm/sysreg.h:717:20: note: in definition of macro =E2=80=98write_sysreg=E2=80=99 u64 __val =3D (u64)(v); \ ^ arch/arm64/kernel/fpsimd.c:713:15: note: in expansion of macro =E2=80=98rea= d_sysreg=E2=80=99 write_sysreg(read_sysreg(CPACR_EL1) | CPACR_EL1_ZEN_EL1EN, CPACR_EL1); ^~~~~~~~~~~ ./arch/arm64/include/asm/sysreg.h:717:6: note: shadowed declaration is here u64 __val =3D (u64)(v); \ ^ arch/arm64/kernel/fpsimd.c:713:2: note: in expansion of macro =E2=80=98writ= e_sysreg=E2=80=99 write_sysreg(read_sysreg(CPACR_EL1) | CPACR_EL1_ZEN_EL1EN, CPACR_EL1); ^~~~~~~~~~~~ -- Best Regards Masahiro Yamada