Received: by 10.223.164.202 with SMTP id h10csp4842980wrb; Tue, 21 Nov 2017 00:11:46 -0800 (PST) X-Google-Smtp-Source: AGs4zMYkmEBKdbe/ALgY2RZ/CR4f8o+xLFmdvDUU55lzVbsn1DeQ/2GGY6YUFXD6Ub5qPs4o+X3R X-Received: by 10.159.211.11 with SMTP id bc11mr16565208plb.187.1511251905976; Tue, 21 Nov 2017 00:11:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511251905; cv=none; d=google.com; s=arc-20160816; b=G5PU/9F8UAk2fPrpIuJj9xjAbCBh1RjKAJ2PFM45WBO/GnZSOFc05/lxxiOo85D/cX 3pND/oloqL3NJejsIeEWnqM/x0Bw6d8RjfpXdUnTDVxW8cSbBWUdXV7TatmcsQWziKx9 jYrKX6YhgKXCNtCkWH+qK0c3pia6j76LpTg9Ce+n6jhJP+ROusbGS1uGEGLzMZvpwYma UtV99le7nlkOBaYO4shHkANrAUH+7OfNhWR9Ama2JaBG/HxnXy3kiTHwj3mqgViGl+FU IN9VHLgur3Ffi65pJOz5xsRruA7ZQLmw8Le/EFMyR6B5mUCniZjG6sPZVWzHDkquUlwa H8oQ== 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:mime-version :organization:references:in-reply-to:date:cc:to:from:subject :message-id:arc-authentication-results; bh=p4NVDNgpm59eBNVclMKIfWbEfBO91YxWZjNJgOJ9Q80=; b=y3BWwlVPkU0xJ2sPi9HRK51ejFxS54BRQtWw/1A4pvtzpxQ+Lf/4T0Z0PoEr61bPzu +wPLJN2RT6kRG/fzcBevIgTSJzFFB9MV0924MbyBOpKZzDo2eWJhRyTSSJNp6ftv+jnP UjG4bq0xDuqqOlsS57dXg0JY/fAQAlorf8lXnfb9TyAD7jonN3FPRPJdczJRzusFdedj 5xh43CJnT9YWxYvkRQTFW00MMQUyx4V/FnLeS8icfTa2mvbxeeGBBjEwDc5cepVuyu9C BOwEvUVAaXwz2pJ2YwyH5CGchCUsoNuDWrHmSFNpBPSxMZeE+tkNWk+XDyuoTSISGaHt vqUQ== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 76si9994578pgf.563.2017.11.21.00.11.35; Tue, 21 Nov 2017 00:11:45 -0800 (PST) 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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751413AbdKUIKv (ORCPT + 73 others); Tue, 21 Nov 2017 03:10:51 -0500 Received: from aserp1040.oracle.com ([141.146.126.69]:44387 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751189AbdKUIKt (ORCPT ); Tue, 21 Nov 2017 03:10:49 -0500 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id vAL8AfUh007241 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 21 Nov 2017 08:10:42 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id vAL8Af8w014191 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 21 Nov 2017 08:10:41 GMT Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id vAL8AeYl004879; Tue, 21 Nov 2017 08:10:40 GMT Received: from ovo (/213.188.19.149) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 21 Nov 2017 00:10:40 -0800 Message-ID: <1511251834.4822.113.camel@oracle.com> Subject: Re: [PATCH 2/7] kbuild: Add P= command line flag to run checkpatch From: Knut Omang To: Jim Davis , Luc Van Oostenryck Cc: Masahiro Yamada , Linux Kernel Mailing List , Michal Marek , Linux Kbuild mailing list , Andy Whitcroft , Joe Perches Date: Tue, 21 Nov 2017 09:10:34 +0100 In-Reply-To: References: <716fa938a4ab0ad66490b72e2ed750cd6583728f.1510840787.git-series.knut.omang@oracle.com> <20171120200827.726yhebihjhrhted@ltop.local> <1511212212.4822.66.camel@oracle.com> <20171120212251.k4uvdstfhg6qtrag@ltop.local> Organization: Oracle Inc Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.24.6 (3.24.6-1.fc26) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Source-IP: aserv0022.oracle.com [141.146.126.234] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2017-11-20 at 17:00 -0700, Jim Davis wrote: > On Mon, Nov 20, 2017 at 2:22 PM, Luc Van Oostenryck > wrote: > > > Should it be possible to somehow keep the distinction between > > the flags coming from KBUILD_CFLAGS and the pure CHECKFLAGS? > > Well, the practical problem seems to be that $(CHECK) is called in > scripts/Makefile.build with both $(CHECKFLAGS) and $(c_flags) as > arguments, regardless of what $(CHECK) is. That can be hacked around > with something inelegant like > > diff --git a/scripts/Makefile.build b/scripts/Makefile.build > index bb831d49bcfd..102194f9afb9 100644 > --- a/scripts/Makefile.build > +++ b/scripts/Makefile.build > @@ -98,14 +98,20 @@ __build: $(if $(KBUILD_BUILTIN),$(builtin-target) > $(lib-target) $(extra-y)) \ > $(subdir-ym) $(always) > @: > > -# Linus' kernel sanity checking tool > +# Linus' kernel sanity checking tool, or $CHECK program of choice > +ifneq ($(KBUILD_CHECKSRC),) > + add_to_checkflags = > + ifeq ($(CHECK),sparse) > + add_to_checkflags = $(c_flags) > + endif > +endif > ifneq ($(KBUILD_CHECKSRC),0) > ifeq ($(KBUILD_CHECKSRC),2) > quiet_cmd_force_checksrc = CHECK $< > - cmd_force_checksrc = $(CHECK) $(CHECKFLAGS) $(c_flags) $< ; > + cmd_force_checksrc = $(CHECK) $(CHECKFLAGS) $(add_to_checkflags) $< > ; > else > quiet_cmd_checksrc = CHECK $< > - cmd_checksrc = $(CHECK) $(CHECKFLAGS) $(c_flags) $< ; > + cmd_checksrc = $(CHECK) $(CHECKFLAGS) $(add_to_checkflags) $< > ; > endif > endif > > and then if I run scripts/checkpatch.pl as $CHECK and pass --quiet > --file as before it works -- until checkpatch returns with a non-zero > exit code, which causes the Makefile to bail at that point. yes, in an earlier version, I added a --no-errors flag to checkpatch to handle that, but based on feedback this version promotes make -k instead. It seems however that that only holds to the next linker step. It is useful to be able to select whether checkpatch should cause make to stop or not. While fixing issues, failure is a better strategy while to assess the state or generate a report, a return 0 behavior is better. > So maybe a wrapper script, with an exit 0 fixup to keep on keeping on > in case of checkpatch warnings or errors, would be better after all. I can prepare a v2 based on the wrapper script I have already. In that version, all added functionality was implemented in the wrapper (including the configuration file parsing) Would you like to keep the checkpatch changes in some form, or would you rather see everything happening in the wrapper? A 3rd possibility that strikes me is that maybe what's needed is a general checker runner that can also take care of running other checks, running multiple checks, and maybe also handling temporary or decided suppression of sparse errors in a similar fashion as I implemented for checkpatch errors. But maybe that can be left to a later change set.. Thanks, Knut From 1584631659065475224@xxx Tue Nov 21 00:01:54 +0000 2017 X-GM-THRID: 1584259521491508959 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread