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: 10172329 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 896F5601E7 for ; Thu, 18 Jan 2018 03:32:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7D303205AF for ; Thu, 18 Jan 2018 03:32:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7B797205D6; Thu, 18 Jan 2018 03:32:44 +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=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D9DD8205FB for ; Thu, 18 Jan 2018 03:32:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=m97s93eAd7ftg/CgvjonUkH64bAWGv/74nQBf1nIEXE=; b=sB7 QCSaYR/HrDFzGeMDV+f3HuUBfw0FN/zMD1df5I6hPFnUuzuctGbS9oYwp69PXdjJ2N8gVneOE6lSu 2azgEjQXutRhLqCNEGBIt0l3D13F+Z+JIYrMid7DRSwXqZasE9g1GxL2q2SDfvnm7dOE0IIKiwDy5 AGK0RkYdxPz+FG41xuWP09yBk/CwZz1J8qjGS5QV+z2YBxXcScO9JDxgh7VI7r+mU9vdQ3tuFQVsk xNrGvkobgZaA5b7nMcnGozvOBIwPtU5roh+qdBYT2bPeaZcEzWIhsXq1Je5ZQ4ctxRHaMIP77zjQv 5s2eqdXbqmjuo0RcrlvRsrQT3v4Y/hg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1ec0wF-00073K-SK; Thu, 18 Jan 2018 03:32:27 +0000 Received: from conuserg-09.nifty.com ([210.131.2.76]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1ec0wB-00072e-S6 for linux-arm-kernel@lists.infradead.org; Thu, 18 Jan 2018 03:32:26 +0000 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 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 X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Michal Marek , Arnd Bergmann , Rob Herring , linux-kernel@vger.kernel.org, Masahiro Yamada , Sam Ravnborg , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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