Received: by 10.223.164.202 with SMTP id h10csp4293864wrb; Mon, 20 Nov 2017 13:05:43 -0800 (PST) X-Google-Smtp-Source: AGs4zMbnLBoYAz9+FdTdyWkadkbt5j+8zT/iSKsr8duH8OB3V+w5msEfO2iZ59Dc3GLE/x0rRmMS X-Received: by 10.101.83.70 with SMTP id w6mr14439623pgr.361.1511211943531; Mon, 20 Nov 2017 13:05:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511211943; cv=none; d=google.com; s=arc-20160816; b=lYVHz4WFzJYGPRztE+eUwpHaJVOkAPPsu7NPnu82y2KZ3jQ3HydwEtJIFGVGvm4L5O OB8NIJ7hXsOG6pTutHOFY13C0kzm7hZrbFXtCwV8c7Kie1MH6jbVjhPuOCcyOSXiMvx4 zBZ9YqnlZ8pad1Hf5aYVu7JFTWDBQG5qDZ6thjvNT4ZhzpWNINGU6rQUrmtrhc2HyMd0 uJMmMX9PWoV7FnKiYsMRl7yLUCzhzV6TOsWEiRMNaxpi23ksZa52H+flsdZ6C0qfg8yY Vdv/xkaSXTN25KvrQv1CjqnUnMg8fJDfmT5RTt4Pv8ktmZe2fe0az3RWeXRbXCkSirQ5 wLTg== 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=wYSEESoYylD0nPRSbH4hvo/3dyjC3UlVKvysZGz3E6U=; b=kJ7ujXMXsD933gSt3MJL2V993oYdOydlYaIAknuvUW2nXw0ic0ZsCFyCAqA7ayMUqj 9cBojMjP5ehjqHk1Al+TFeDtQTMt1F44Zjx2GNlNOVJJbsapt4XGV9aYcieGZzLfxfGk sahaULfKKKFdhhzGJxqHsDvNimxRnnEGPxFKyrOKbz9iiHFV5DMPN8V344EzFnuZVWMX HAB3xS3zHdSdQaxz7MKvBKInO+JlSeWlSMXyzLiACnZDYTgGXO9BWlJaRCOzo5XIijOR QxEvECEI6OfLc6k/Xh2UYvJ2dqo3qKLUMrYtzWRMJVZrQcXvIxXMn2+VneogkVp4KlQ2 M/cA== 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 k14si8711046pgt.316.2017.11.20.13.05.33; Mon, 20 Nov 2017 13:05:43 -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 S1752890AbdKTVEy convert rfc822-to-8bit (ORCPT + 67 others); Mon, 20 Nov 2017 16:04:54 -0500 Received: from aserp1040.oracle.com ([141.146.126.69]:34313 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751151AbdKTVEx (ORCPT ); Mon, 20 Nov 2017 16:04:53 -0500 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id vAKL4lmO003881 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 20 Nov 2017 21:04:48 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id vAKL4lFp020785 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 20 Nov 2017 21:04:47 GMT Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id vAKL4k5l021283; Mon, 20 Nov 2017 21:04:47 GMT Received: from ovo (/213.188.19.149) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 20 Nov 2017 13:04:46 -0800 Message-ID: <1511211881.4822.61.camel@oracle.com> Subject: Re: [PATCH 2/7] kbuild: Add P= command line flag to run checkpatch From: Knut Omang To: Masahiro Yamada Cc: Linux Kernel Mailing List , Michal Marek , Linux Kbuild mailing list Date: Mon, 20 Nov 2017 22:04:41 +0100 In-Reply-To: References: <716fa938a4ab0ad66490b72e2ed750cd6583728f.1510840787.git-series.knut.omang@oracle.com> 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: 8BIT X-Source-IP: userv0022.oracle.com [156.151.31.74] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2017-11-21 at 01:18 +0900, Masahiro Yamada wrote: > 2017-11-17 2:01 GMT+09:00 Knut Omang : > > Add interpretation of a new environment variable P={1,2} in spirit of the > > C= option, but executing checkpatch instead of sparse. > > > > Signed-off-by: Knut Omang > > Reviewed-by: Håkon Bugge > > Acked-by: Åsmund Østvold > > --- > > Makefile | 20 +++++++++++++++++++- > > scripts/Makefile.build | 13 +++++++++++++ > > 2 files changed, 32 insertions(+), 1 deletion(-) > > > > diff --git a/Makefile b/Makefile > > index ccd9818..eb4bca9 100644 > > --- a/Makefile > > +++ b/Makefile > > @@ -176,6 +176,20 @@ ifndef KBUILD_CHECKSRC > > KBUILD_CHECKSRC = 0 > > endif > > > > +# Run scripts/checkpatch.pl with --ignore-cfg checkpatch.cfg > > +# > > +# Use 'make P=1' to enable checking of only re-compiled files. > > +# Use 'make P=2' to enable checking of *all* source files, regardless > > +# > > +# See the file "Documentation/dev-tools/run-checkpatch.rst" for more > > details, > > +# > > +ifeq ("$(origin P)", "command line") > > + KBUILD_CHECKPATCH = $(P) > > +endif > > +ifndef KBUILD_CHECKPATCH > > + KBUILD_CHECKPATCH = 0 > > +endif > > > I am unhappy about adding a new interface > for each checker. I see your point. I wanted to extend C= to handle checkpatch as well but see no obvious good non-intrusive solution. > The default of CHECK is "sparse", but > users can override it to use another checker. > > > > As Decumentation/dev-tools/coccinelle.rst says, > if you want to use coccinelle as a checker, > > make C=1 CHECK="scripts/coccicheck" That works well with coccinelle since both sparse and coccinelle rely on getting the same command line options as what's passed to the compiler, while checkpatch is quite different: make C=2 CHECK="\$(srctree)/scripts/checkpatch.pl" fails, complaining about every single compiler flag. Thanks, Knut > Recently, I saw a patch to use scripts/kernel-doc as a checker. > https://patchwork.kernel.org/patch/10030521/ > > > > If I accept your patch, > we would end up with > > KBUILD_CHECKPATCH, > KBUILD_CHECKCOCCI > KBUILD_CHECKDOC, > ... > > This is ugly. From 1584617042798389788@xxx Mon Nov 20 20:09:35 +0000 2017 X-GM-THRID: 1584259521491508959 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread