From patchwork Thu Jan 18 03:31:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 10172331 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 62DB5601E7 for ; Thu, 18 Jan 2018 03:33:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5772E1FFF9 for ; Thu, 18 Jan 2018 03:33:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 49D6C204C4; Thu, 18 Jan 2018 03:33:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C36EA1FFF9 for ; Thu, 18 Jan 2018 03:33:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753279AbeARDdJ (ORCPT ); Wed, 17 Jan 2018 22:33:09 -0500 Received: from conuserg-09.nifty.com ([210.131.2.76]:57098 "EHLO conuserg-09.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752689AbeARDdH (ORCPT ); Wed, 17 Jan 2018 22:33:07 -0500 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-09.nifty.com with ESMTP id w0I3VlVX027175; Thu, 18 Jan 2018 12:31:48 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com w0I3VlVX027175 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1516246309; bh=USXhGvA8vg7p34jSoAxcuKSkWHZ61bK2gNlfalITDlM=; h=From:To:Cc:Subject:Date:From; b=Yw7PxEVjwsl7k0r8o/WYqq8FWts50XzJOx7Odjo8gsmrKIrHoWlbStysG2RyI00oT lddmcBys+3EZos+X/B+ZEf4U4lZMQ8MTkRa2Zn3hSc6r9rTtbDihxUGN6whDTJLAJy CKXd/w6szt8cxcnVlHOds2hWgUdQE4JIIYfB4QCwekqumI4GJRTTpEefLy7COESfF3 40syHMu63MMxVQAnCLdW/1FsiSkizf05lKZRpRTmjOcjEXH3xWRKrXWrjozR0cZCpl c+RgbyZsQjmHktMCsbVlYtp/5bFNeBLLskb0SE4Pq1N7wZDy/Tfzes6UmAu52gRlYr mIT8LpR2qJkOg== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, Arnd Bergmann , devicetree@vger.kernel.org, Rob Herring , Sam Ravnborg , Michal Marek , Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH] kbuild: fix W= option checks for extra DTC warnings Date: Thu, 18 Jan 2018 12:31:46 +0900 Message-Id: <1516246306-12851-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Kbuild supports 3 levels of extra warnings, and multiple levels can be combined, like W=12, W=123. It was added by commit a6de553da01c ("kbuild: Allow to combine multiple W= levels"). From the log of commit 8654cb8d0371 ("dtc: update warning settings for new bus and node/property name checks"), I assume: - unit_address_vs_reg, simple_bus_reg, etc. belong to level 1 - node_name_chars_strict, property_name_chars_strict belong to level 2 However, the level 1 warnings are displayed by any argument to W=. On the other hand, the level 2 warnings are displayed by W=2, but not by W=12, or W=123. Use $(findstring ...) like scripts/Makefile.extrawarn. Signed-off-by: Masahiro Yamada Acked-by: Arnd Bergmann --- Side Notes for possible additional works: [1] I implemented DTC extra warnings differently in U-Boot: https://github.com/u-boot/u-boot/blob/v2018.01/scripts/Makefile.extrawarn#L64 Better to collect extra warning stuff into scripts/Makefile.extrawarn ? [2] KBUILD_ENABLE_EXTRA_GCC_CHECKS is getting a historical misnomer because we use it for Clang and DTC too. Better to rename? (keeping backward-compatibility for a while)? scripts/Makefile.lib | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 1ca4dcd..7dee1da 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -264,7 +264,7 @@ cmd_gzip = (cat $(filter-out FORCE,$^) | gzip -n -f -9 > $@) || \ DTC ?= $(objtree)/scripts/dtc/dtc # Disable noisy checks by default -ifeq ($(KBUILD_ENABLE_EXTRA_GCC_CHECKS),) +ifeq ($(findstring 1,$(KBUILD_ENABLE_EXTRA_GCC_CHECKS)),) DTC_FLAGS += -Wno-unit_address_vs_reg \ -Wno-simple_bus_reg \ -Wno-unit_address_format \ @@ -273,7 +273,7 @@ DTC_FLAGS += -Wno-unit_address_vs_reg \ -Wno-pci_device_reg endif -ifeq ($(KBUILD_ENABLE_EXTRA_GCC_CHECKS),2) +ifneq ($(findstring 2,$(KBUILD_ENABLE_EXTRA_GCC_CHECKS)),) DTC_FLAGS += -Wnode_name_chars_strict \ -Wproperty_name_chars_strict endif