Message ID | 20231122-dtc-warnings-v2-0-bd4087325392@kernel.org |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:6358:6f03:b0:164:83eb:24d7 with SMTP id r3csp1534247rwn; Wed, 22 Nov 2023 14:12:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IFDyxxiQ3DaOv4snMgcot3OWJkjRTvN8ymUaIUuVCPNPy4qAp9B5L1/xayOfnsoWZVGL/+I X-Received: by 2002:a05:6808:ec6:b0:3b8:33e5:30ea with SMTP id q6-20020a0568080ec600b003b833e530eamr4509897oiv.29.1700691165169; Wed, 22 Nov 2023 14:12:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700691165; cv=none; d=google.com; s=arc-20160816; b=rtd8crgROiNFgSWJDX3yW1xbVNlh53GYPNGliwDlpISRVn39VVRQ5hMzEAyQCP+ZZI HKY3CYESU6i4f/r3EGe4Pp+NmSgLKHzAwLoLyoFFKet+lp/NZ8sVhjlbXlPccgVrJOqG G1TpDmulwG8Mcba/3VQ2LXkFz6kWMGkkQcZy6lieOir2D5tccy1yO1wTXBMR4+VOP62Y 7woXcy9ub63hCQVMHyIkBBSN4ampK5oQT3CXV9iJk/8Ji2zwBt61k17Iuiv5eGCLJ4YV yztLHh3ZSFEl8IQrhXCyJI0vh7GTWbvmsAxAUbYk09nOMc6Ck5wMOr1/MjT429yPuc7J +OGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:content-transfer-encoding:mime-version :message-id:date:subject:from; bh=sK7kv4eKhyN2VRY462hcU4dvihYdA9xvtn9OEHW15Ho=; fh=6XhT80vtV/DUGFkwUDhZq8fq9LBQQeyCFG0V/SG+9+A=; b=zNB7zPW/YnX6n293YMWXie7xPSKvisQIwfHf3OV8+cRuDif7bui68jhpkJC/E9ZExx CvhZ7xYjQjsoU5yiS6cBaCFSqBjgPehaQmC0GVKE546pozxfiUPzvW7bBJEuk8V9X2e2 oCdPXUl0ZRuAJv1A/7vK7HdHnodsebbkJc7omQbf+z77sK4NZlG8zlRik+NMmHdS2uwF NtL+7ZgJ7FfbQ8EOjLDZNk0QSjw4Q/j+OIK7ImQB6OxCRXFWwP9zq/DxsUCq9iGqq3yb aHLNsk5Tl89h8Y0UlECM87WREvbPqscHcNk00OLkz6EXouk519JRQv2iPd9HzvrOdiuI I/5g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id u2-20020a63d342000000b005b8f24e6526si19878pgi.234.2023.11.22.14.12.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 14:12:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id D9E2280EE733; Wed, 22 Nov 2023 14:12:40 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233574AbjKVWMm (ORCPT <rfc822;ouuuleilei@gmail.com> + 99 others); Wed, 22 Nov 2023 17:12:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231392AbjKVWMl (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 22 Nov 2023 17:12:41 -0500 Received: from mail-il1-f179.google.com (mail-il1-f179.google.com [209.85.166.179]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 618C410C; Wed, 22 Nov 2023 14:12:37 -0800 (PST) Received: by mail-il1-f179.google.com with SMTP id e9e14a558f8ab-35aa6107e9fso996535ab.0; Wed, 22 Nov 2023 14:12:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700691156; x=1701295956; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=sK7kv4eKhyN2VRY462hcU4dvihYdA9xvtn9OEHW15Ho=; b=LROf73TQKDRVlZt9L8bOefE2MsSRWep4zvW0aP6cKWM4lFParlzs/yTfeyu8kfMhlt le7cZ2dv3ixopMniF5JpfRvJvQXzJkLU7fhbS2ktld1JydqVpMXnvIEqjBJHM7Qem59y M4mIemUyHV4fzBAdMMjQtvQTbEN9kx3laZjYUDmXvCpWLZEaKp+F+kveNLv7YbSqTCGS dO+Lr5TKMr41q9sWnD/LRbX3Hmoz8EiuoDDoINpEpoJWITib+csl5/jfYzyOt/FnajxU 8evXegFhWnvzMamqX4v7fMEW627Y3yBJKFk9gZGloz93KCZNbwAx29kl9ECtBgfQMC9q 6rkQ== X-Gm-Message-State: AOJu0Yx6McJT3Hrtdxf/HFYEnV+bewo3YQkcuKqLvyRDGFYU8jKk2yj2 DOEcVOxue0b9MZwdWBAM2g== X-Received: by 2002:a92:c685:0:b0:358:104:679d with SMTP id o5-20020a92c685000000b003580104679dmr4053847ilg.28.1700691156570; Wed, 22 Nov 2023 14:12:36 -0800 (PST) Received: from herring.priv ([64.188.179.252]) by smtp.gmail.com with ESMTPSA id y36-20020a029527000000b004665e39708esm88692jah.147.2023.11.22.14.12.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 14:12:35 -0800 (PST) Received: (nullmailer pid 2753833 invoked by uid 1000); Wed, 22 Nov 2023 22:12:33 -0000 From: Rob Herring <robh@kernel.org> Subject: [PATCH v2 0/4] kbuild: Per arch/platform dtc warning levels Date: Wed, 22 Nov 2023 15:12:31 -0700 Message-Id: <20231122-dtc-warnings-v2-0-bd4087325392@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAM98XmUC/x3MQQqAIBBA0avIrBNyBLGuEi1ER5uNhUYF4d2Tl m/x/wuVClOFWbxQ6OLKe+7AQYDfXE4kOXQDjqiVQpTh9PJ2JXNOVU7Gxmi1s4YC9OQoFPn5d8v a2gcKn3iHXgAAAA== To: Masahiro Yamada <masahiroy@kernel.org>, Nathan Chancellor <nathan@kernel.org>, Nick Desaulniers <ndesaulniers@google.com>, Nicolas Schier <nicolas@fjasle.eu>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org>, Paul Walmsley <paul.walmsley@sifive.com>, Palmer Dabbelt <palmer@dabbelt.com>, Albert Ou <aou@eecs.berkeley.edu>, Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>, Alim Akhtar <alim.akhtar@samsung.com>, Conor Dooley <conor@kernel.org> Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-riscv@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org X-Mailer: b4 0.13-dev X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 22 Nov 2023 14:12:41 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783303939147791632 X-GMAIL-MSGID: 1783303939147791632 |
Series |
kbuild: Per arch/platform dtc warning levels
|
|
Message
Rob Herring
Nov. 22, 2023, 10:12 p.m. UTC
This series adds support to set the dtc extra warning level on a per
arch or per platform (directory really) basis.
The first version of this was just a simple per directory override for
Samsung platforms, but Conor asked to be able to do this for all of
riscv.
For merging, either I can take the whole thing or the riscv and samsung
patches can go via their normal trees. The added variable will have no
effect until merged with patch 2.
v1:
- https://lore.kernel.org/all/20231116211739.3228239-1-robh@kernel.org/
Signed-off-by: Rob Herring <robh@kernel.org>
---
Rob Herring (4):
kbuild: Move dtc graph_child_address warning to W=2
kbuild: Allow arch/platform override of dtc warning level
riscv: dts: Always enable extra W=1 warnings
arm/arm64: dts: samsung: Always enable extra W=1 warnings
arch/arm/boot/dts/samsung/Makefile | 3 +++
arch/arm64/boot/dts/exynos/Makefile | 3 +++
arch/riscv/boot/dts/Makefile | 3 +++
scripts/Makefile.lib | 16 +++++++++-------
4 files changed, 18 insertions(+), 7 deletions(-)
---
base-commit: b85ea95d086471afb4ad062012a4d73cd328fa86
change-id: 20231122-dtc-warnings-968ff83a86ed
Best regards,
Comments
On Thu, Nov 23, 2023 at 7:12 AM Rob Herring <robh@kernel.org> wrote: > > This series adds support to set the dtc extra warning level on a per > arch or per platform (directory really) basis. > > The first version of this was just a simple per directory override for > Samsung platforms, but Conor asked to be able to do this for all of > riscv. > > For merging, either I can take the whole thing or the riscv and samsung > patches can go via their normal trees. The added variable will have no > effect until merged with patch 2. > > v1: > - https://lore.kernel.org/all/20231116211739.3228239-1-robh@kernel.org/ > > Signed-off-by: Rob Herring <robh@kernel.org> > --- There were some attempts in the past to enable W=1 in particular subsystems, so here is a similar comment. Adding a new warning flag to W=1 is always safe without doing any compile test. With this series, it would not be true any more because a new warning in W=1 would potentially break riscv/samsung platforms. Linus requires a clean build (i.e. zero warning) when W= option is not given. > Rob Herring (4): > kbuild: Move dtc graph_child_address warning to W=2 > kbuild: Allow arch/platform override of dtc warning level > riscv: dts: Always enable extra W=1 warnings > arm/arm64: dts: samsung: Always enable extra W=1 warnings > > arch/arm/boot/dts/samsung/Makefile | 3 +++ > arch/arm64/boot/dts/exynos/Makefile | 3 +++ > arch/riscv/boot/dts/Makefile | 3 +++ > scripts/Makefile.lib | 16 +++++++++------- > 4 files changed, 18 insertions(+), 7 deletions(-) > --- > base-commit: b85ea95d086471afb4ad062012a4d73cd328fa86 > change-id: 20231122-dtc-warnings-968ff83a86ed > > Best regards, > -- > Rob Herring <robh@kernel.org> >
Yo, On Thu, Nov 23, 2023 at 04:38:37PM +0900, Masahiro Yamada wrote: > On Thu, Nov 23, 2023 at 7:12 AM Rob Herring <robh@kernel.org> wrote: > > > > This series adds support to set the dtc extra warning level on a per > > arch or per platform (directory really) basis. > > > > The first version of this was just a simple per directory override for > > Samsung platforms, but Conor asked to be able to do this for all of > > riscv. > > > > For merging, either I can take the whole thing or the riscv and samsung > > patches can go via their normal trees. The added variable will have no > > effect until merged with patch 2. > > > > v1: > > - https://lore.kernel.org/all/20231116211739.3228239-1-robh@kernel.org/ > > > > Signed-off-by: Rob Herring <robh@kernel.org> > > --- > > > There were some attempts in the past to enable W=1 in particular subsystems, > so here is a similar comment. > > Adding a new warning flag to W=1 is always safe without doing any compile test. > > With this series, it would not be true any more because a new warning in W=1 > would potentially break riscv/samsung platforms. We carry a copy of the dtc in scripts/dtc, so I would expect that before an upgrade is done that would introduce new warnings we can fix them in the relevant platforms. Perhaps I am misunderstanding something there, but I'm sure Rob can clear it up if I made a mistake. > Linus requires a clean build (i.e. zero warning) when W= option is not given. For RISC-V at least, there are currently no W=1 warnings while building the dtbs (because I put effort into fixing them all) and I would like to keep it that way, so that requirement is not a concern. Cheers, Conor.
On Wed, Nov 22, 2023 at 03:12:31PM -0700, Rob Herring wrote: > This series adds support to set the dtc extra warning level on a per > arch or per platform (directory really) basis. > > The first version of this was just a simple per directory override for > Samsung platforms, but Conor asked to be able to do this for all of > riscv. > > For merging, either I can take the whole thing or the riscv and samsung > patches can go via their normal trees. The added variable will have no > effect until merged with patch 2. IMO, you should take the lot. Acked-by: Conor Dooley <conor.dooley@microchip.com> Cheers, Conor.
On Thu, Nov 23, 2023 at 6:44 PM Conor Dooley <conor.dooley@microchip.com> wrote: > > Yo, > > On Thu, Nov 23, 2023 at 04:38:37PM +0900, Masahiro Yamada wrote: > > On Thu, Nov 23, 2023 at 7:12 AM Rob Herring <robh@kernel.org> wrote: > > > > > > This series adds support to set the dtc extra warning level on a per > > > arch or per platform (directory really) basis. > > > > > > The first version of this was just a simple per directory override for > > > Samsung platforms, but Conor asked to be able to do this for all of > > > riscv. > > > > > > For merging, either I can take the whole thing or the riscv and samsung > > > patches can go via their normal trees. The added variable will have no > > > effect until merged with patch 2. > > > > > > v1: > > > - https://lore.kernel.org/all/20231116211739.3228239-1-robh@kernel.org/ > > > > > > Signed-off-by: Rob Herring <robh@kernel.org> > > > --- > > > > > > There were some attempts in the past to enable W=1 in particular subsystems, > > so here is a similar comment. > > > > Adding a new warning flag to W=1 is always safe without doing any compile test. > > > > With this series, it would not be true any more because a new warning in W=1 > > would potentially break riscv/samsung platforms. > > We carry a copy of the dtc in scripts/dtc, so I would expect that before > an upgrade is done that would introduce new warnings we can fix them in > the relevant platforms. It might be easy to fix up only riscv and samsung platforms. If more and more platforms add KBUILD_EXTRA_WARN=1 in their Makefiles, it will become harder to sort them out before adding a new warning flag. The sync of scripts/dtc will be delayed until then, or you will end up with demoting them (i.e. delete KBUILD_EXTRA_WARN=1). > Perhaps I am misunderstanding something there, > but I'm sure Rob can clear it up if I made a mistake. > > > Linus requires a clean build (i.e. zero warning) when W= option is not given. > > For RISC-V at least, there are currently no W=1 warnings while building > the dtbs (because I put effort into fixing them all) and I would like to > keep it that way, so that requirement is not a concern. > > Cheers, > Conor. >
On Thu, Nov 23, 2023 at 1:39 AM Masahiro Yamada <masahiroy@kernel.org> wrote: > > On Thu, Nov 23, 2023 at 7:12 AM Rob Herring <robh@kernel.org> wrote: > > > > This series adds support to set the dtc extra warning level on a per > > arch or per platform (directory really) basis. > > > > The first version of this was just a simple per directory override for > > Samsung platforms, but Conor asked to be able to do this for all of > > riscv. > > > > For merging, either I can take the whole thing or the riscv and samsung > > patches can go via their normal trees. The added variable will have no > > effect until merged with patch 2. > > > > v1: > > - https://lore.kernel.org/all/20231116211739.3228239-1-robh@kernel.org/ > > > > Signed-off-by: Rob Herring <robh@kernel.org> > > --- > > > There were some attempts in the past to enable W=1 in particular subsystems, > so here is a similar comment. > > Adding a new warning flag to W=1 is always safe without doing any compile test. > > With this series, it would not be true any more because a new warning in W=1 > would potentially break riscv/samsung platforms. The difference here is the people potentially adding warnings are also the ones ensuring no warnings. > Linus requires a clean build (i.e. zero warning) when W= option is not given. Linus doesn't build any of this AFAICT. We are not always warning free for W=0 with dtbs. Rob
On Mon, Nov 27, 2023 at 11:03 PM Rob Herring <robh@kernel.org> wrote: > > On Thu, Nov 23, 2023 at 1:39 AM Masahiro Yamada <masahiroy@kernel.org> wrote: > > > > On Thu, Nov 23, 2023 at 7:12 AM Rob Herring <robh@kernel.org> wrote: > > > > > > This series adds support to set the dtc extra warning level on a per > > > arch or per platform (directory really) basis. > > > > > > The first version of this was just a simple per directory override for > > > Samsung platforms, but Conor asked to be able to do this for all of > > > riscv. > > > > > > For merging, either I can take the whole thing or the riscv and samsung > > > patches can go via their normal trees. The added variable will have no > > > effect until merged with patch 2. > > > > > > v1: > > > - https://lore.kernel.org/all/20231116211739.3228239-1-robh@kernel.org/ > > > > > > Signed-off-by: Rob Herring <robh@kernel.org> > > > --- > > > > > > There were some attempts in the past to enable W=1 in particular subsystems, > > so here is a similar comment. > > > > Adding a new warning flag to W=1 is always safe without doing any compile test. > > > > With this series, it would not be true any more because a new warning in W=1 > > would potentially break riscv/samsung platforms. > > The difference here is the people potentially adding warnings are also > the ones ensuring no warnings. > > > Linus requires a clean build (i.e. zero warning) when W= option is not given. > > Linus doesn't build any of this AFAICT. We are not always warning free > for W=0 with dtbs. Does it mean, you can enable all warnings by default? > > Rob >
On Tue, Nov 28, 2023 at 6:03 AM Masahiro Yamada <masahiroy@kernel.org> wrote: > > On Mon, Nov 27, 2023 at 11:03 PM Rob Herring <robh@kernel.org> wrote: > > > > On Thu, Nov 23, 2023 at 1:39 AM Masahiro Yamada <masahiroy@kernel.org> wrote: > > > > > > On Thu, Nov 23, 2023 at 7:12 AM Rob Herring <robh@kernel.org> wrote: > > > > > > > > This series adds support to set the dtc extra warning level on a per > > > > arch or per platform (directory really) basis. > > > > > > > > The first version of this was just a simple per directory override for > > > > Samsung platforms, but Conor asked to be able to do this for all of > > > > riscv. > > > > > > > > For merging, either I can take the whole thing or the riscv and samsung > > > > patches can go via their normal trees. The added variable will have no > > > > effect until merged with patch 2. > > > > > > > > v1: > > > > - https://lore.kernel.org/all/20231116211739.3228239-1-robh@kernel.org/ > > > > > > > > Signed-off-by: Rob Herring <robh@kernel.org> > > > > --- > > > > > > > > > There were some attempts in the past to enable W=1 in particular subsystems, > > > so here is a similar comment. > > > > > > Adding a new warning flag to W=1 is always safe without doing any compile test. > > > > > > With this series, it would not be true any more because a new warning in W=1 > > > would potentially break riscv/samsung platforms. > > > > The difference here is the people potentially adding warnings are also > > the ones ensuring no warnings. > > > > > Linus requires a clean build (i.e. zero warning) when W= option is not given. > > > > Linus doesn't build any of this AFAICT. We are not always warning free > > for W=0 with dtbs. > > > > Does it mean, you can enable all warnings by default? No, Linus might not care, but others (me) do. The whole point of not allowing warnings is the same. Get to zero warnings so any new warnings stand out. We now have some subset of platforms which are warning free and want warnings enabled by default to keep them that way. How do you suggest we do that? I understand your point on W=1 in general, but I think it just doesn't apply in this case. In general, someone may be testing a new compiler and there's some new warning to enable, so they add it to W=1. They are working independently of any subsystem (and Linus) and introducing new warnings would be a burden to fix and a problem to leave. For DT, it is a bit different as adding new warnings, updating dtc version, and selecting warnings to enable are pretty much all done together. Plus, schema warnings have pretty much superseded dtc warnings. If we do add new warnings which can't be fixed up front, then we could still only enable the warning for W=1 from the command line. Something like this on top of this series: diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 53a74e53e0ca..41307c6e1fee 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -341,6 +341,10 @@ quiet_cmd_gzip = GZIP $@ # --------------------------------------------------------------------------- DTC ?= $(objtree)/scripts/dtc/dtc +ifeq ($(findstring 1,$(KBUILD_EXTRA_WARN)),) +DTC_FLAGS += -Wno-some_new_warning_we_need_off_globally +endif + KBUILD_EXTRA_WARN_DTC += $(KBUILD_EXTRA_WARN) # Disable noisy checks by default
On Wed, Nov 29, 2023 at 7:25 AM Rob Herring <robh@kernel.org> wrote: > > On Tue, Nov 28, 2023 at 6:03 AM Masahiro Yamada <masahiroy@kernel.org> wrote: > > > > On Mon, Nov 27, 2023 at 11:03 PM Rob Herring <robh@kernel.org> wrote: > > > > > > On Thu, Nov 23, 2023 at 1:39 AM Masahiro Yamada <masahiroy@kernel.org> wrote: > > > > > > > > On Thu, Nov 23, 2023 at 7:12 AM Rob Herring <robh@kernel.org> wrote: > > > > > > > > > > This series adds support to set the dtc extra warning level on a per > > > > > arch or per platform (directory really) basis. > > > > > > > > > > The first version of this was just a simple per directory override for > > > > > Samsung platforms, but Conor asked to be able to do this for all of > > > > > riscv. > > > > > > > > > > For merging, either I can take the whole thing or the riscv and samsung > > > > > patches can go via their normal trees. The added variable will have no > > > > > effect until merged with patch 2. > > > > > > > > > > v1: > > > > > - https://lore.kernel.org/all/20231116211739.3228239-1-robh@kernel.org/ > > > > > > > > > > Signed-off-by: Rob Herring <robh@kernel.org> > > > > > --- > > > > > > > > > > > > There were some attempts in the past to enable W=1 in particular subsystems, > > > > so here is a similar comment. > > > > > > > > Adding a new warning flag to W=1 is always safe without doing any compile test. > > > > > > > > With this series, it would not be true any more because a new warning in W=1 > > > > would potentially break riscv/samsung platforms. > > > > > > The difference here is the people potentially adding warnings are also > > > the ones ensuring no warnings. > > > > > > > Linus requires a clean build (i.e. zero warning) when W= option is not given. > > > > > > Linus doesn't build any of this AFAICT. We are not always warning free > > > for W=0 with dtbs. > > > > > > > > Does it mean, you can enable all warnings by default? > > No, Linus might not care, but others (me) do. The whole point of not > allowing warnings is the same. Get to zero warnings so any new > warnings stand out. We now have some subset of platforms which are > warning free and want warnings enabled by default to keep them that > way. How do you suggest we do that? You may not like it, but an alternative solution could be, hard-code extra warning flags. In my compile-tests, Samsung platform is not W=1 clean yet. I see -Wunit_address_vs_reg, -Wsimple_bus_reg, -Wunique_unit_address_if_enabled warnings. I do not see anything else, so you can add the following three flags to keep it warning-free. diff --git a/arch/arm/boot/dts/samsung/Makefile b/arch/arm/boot/dts/samsung/Makefile index 7becf36656b1..1e15784ec51f 100644 --- a/arch/arm/boot/dts/samsung/Makefile +++ b/arch/arm/boot/dts/samsung/Makefile @@ -1,4 +1,10 @@ # SPDX-License-Identifier: GPL-2.0 + +dtcflags := \ + -Wavoid_unnecessary_addr_size \ + -Walias_paths \ + -Wgraph_child_address + dtb-$(CONFIG_ARCH_EXYNOS3) += \ exynos3250-artik5-eval.dtb \ exynos3250-monk.dtb \ diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 1a965fe68e01..aa5a5fc39cec 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -362,6 +362,9 @@ DTC_FLAGS += -Wnode_name_chars_strict \ -Wunique_unit_address endif +# per-directory flags +DTC_FLAGS += $(dtcflags) +# per-file flags DTC_FLAGS += $(DTC_FLAGS_$(basetarget)) # Set -@ if the target is a base DTB that overlay is applied onto > > I understand your point on W=1 in general, but I think it just doesn't > apply in this case. In general, > someone may be testing a new compiler and there's some new warning to > enable, so they add it to W=1. They are working independently of any > subsystem (and Linus) and introducing new warnings would be a burden > to fix and a problem to leave. For DT, it is a bit different as adding > new warnings, updating dtc version, and selecting warnings to enable > are pretty much all done together. > Plus, schema warnings have pretty > much superseded dtc warnings. If we do add new warnings which can't be > fixed up front, then we could still only enable the warning for W=1 > from the command line. Something like this on top of this series: > > diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib > index 53a74e53e0ca..41307c6e1fee 100644 > --- a/scripts/Makefile.lib > +++ b/scripts/Makefile.lib > @@ -341,6 +341,10 @@ quiet_cmd_gzip = GZIP $@ > # --------------------------------------------------------------------------- > DTC ?= $(objtree)/scripts/dtc/dtc > > +ifeq ($(findstring 1,$(KBUILD_EXTRA_WARN)),) > +DTC_FLAGS += -Wno-some_new_warning_we_need_off_globally > +endif > + Hmm. Tricky, but works. KBUILD_EXTRA_WARN_DTC=1 is weaker than KBUILD_EXTRA_WARN=1 > KBUILD_EXTRA_WARN_DTC += $(KBUILD_EXTRA_WARN) > > # Disable noisy checks by default > -- Best Regards Masahiro Yamada