Received: by 10.223.164.202 with SMTP id h10csp546310wrb; Fri, 17 Nov 2017 05:00:43 -0800 (PST) X-Google-Smtp-Source: AGs4zMb1Uq0SCfC9f+o21fUo22y4KTvqKr3s5LY2zTS01lC8KWi1T391u1HJ+x1f9H6R5ph/Thpv X-Received: by 10.101.64.70 with SMTP id h6mr5089441pgp.144.1510923643528; Fri, 17 Nov 2017 05:00:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510923643; cv=none; d=google.com; s=arc-20160816; b=YrKqKxAJgbJIBUp2I1ARZZJIiCsvdubZWTWPuVaDacG401lV+4QTTJAptH6LkWjfYi es7NeNqjyLiphkyqWThdjo2z2F9zL084U2xpQ+T6XK0hZ//xMmAxqkZUCpBa15XhQXDl 3m52B+WJ0RZkveRSAlumyUF0hIhezsbfHCtKnaOtmUZfNjaKqRw4lv7EVaD3/dYOL8nP 638SAW/Byel7sUnWHL6m4bMbLhewA29A4QbYBz6YVBWBrcq+AyVxUio3GKccMqwDA9zr bgR0Plmo/EwUau4Y0KMWvfso/+fmDVtwGjAOTOtSpL+yYuJNIoZeVjWNEBXbQwzyvDLf ia7w== 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 :references:in-reply-to:date:cc:to:from:subject:message-id :arc-authentication-results; bh=BSsm/LaXwRDpwo7wj+jFrRB3ENfF3R9/N4FB/Fb/dUo=; b=fuQ3V2A3P2Pm8eCGGQmSMOolh0ru0AZ+eBKkdffKRTpBX5a9+Zy1u9h1/m1wrmTdkG Ylea6LiG1kjvgT9v2Ng5KqyySj/nYPbUx4tVamSKCxlMSksh3jtbBSDEZL+PWCoWknWY zLA2wPQU4IzD3IK/KN5R+uyNSsEf8j40BZdpy7g6XblUiB9nRjwy4xrfoVWm8p01M94J L8vQErtwGzUiVttfp+XWQPuf1WwubHJAFKKO3f89Kqb93olFBa1ioVuRBIXSqkPaDpbM QdMZepvEg7HNRQzcrg4jVdnp6Bhm8cHolzF15bzQV5fSlDYj6HUcfvRHjIdYSqajIESn 417w== 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 x14si2998510pfj.235.2017.11.17.05.00.30; Fri, 17 Nov 2017 05:00: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 S933274AbdKQErj convert rfc822-to-8bit (ORCPT + 91 others); Thu, 16 Nov 2017 23:47:39 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:23190 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932630AbdKQErc (ORCPT ); Thu, 16 Nov 2017 23:47:32 -0500 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id vAH4lHTD016082 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 17 Nov 2017 04:47:17 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id vAH4lGF9014529 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 17 Nov 2017 04:47:16 GMT Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id vAH4lFd3001055; Fri, 17 Nov 2017 04:47:15 GMT Received: from asu (/10.175.209.58) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 16 Nov 2017 20:47:14 -0800 Message-ID: <1510894030.3063.41.camel@oracle.com> Subject: Re: [PATCH 0/7] Support for automatic checkpatch running in the kernel From: Knut Omang To: Kees Cook Cc: LKML , =?ISO-8859-1?Q?=C5smund_=D8stvold?= , =?ISO-8859-1?Q?H=E5kon?= Bugge , John Haxby , linux-doc@vger.kernel.org, linux-kbuild , Mauro Carvalho Chehab , =?ISO-8859-1?Q?Micka=EBl_Sala=FCn?= , Joe Perches Date: Fri, 17 Nov 2017 05:47:10 +0100 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.6 (3.22.6-2.fc25) Mime-Version: 1.0 Content-Transfer-Encoding: 8BIT X-Source-IP: userv0021.oracle.com [156.151.31.71] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2017-11-16 at 14:57 -0800, Kees Cook wrote: > On Thu, Nov 16, 2017 at 9:01 AM, Knut Omang wrote: > > The most important checkpatch feature added is the --ignore-cfg feature, which > > takes a file argument and parses that file according to this minimal language: > > > >        # comments > >        line_len > >        except checkpatch_type [files ...] > >        pervasive checkpatch_type1 [checkpatch_type2 ...] > > > > With "make P=2" checkpatch is called with "--file" and "--ignore_cfg > > checkpatch.cfg" which causes it to look for a file named 'checkpatch.cfg' in the > > same directory as the source file. If that file exists, checkpatch will be run > > with an implicit --strict and with the @ignore list expanded with content from > > the configuration file.  If it does not exist, make will simply silently ignore > > the file. > > Will these configurations be cascading? (For example, all of net/ uses > a different comment style, so having that recorded in a single file > would be nice.) Good point, the net/ use case is certainly something I have been thinking about. I didn't want to make it too complex in the first set, so I let patch 1-4 implement the basics with one file per directory and nothing across directories. Patch 6 and 7 in this set extends this to "fallback", which (with the net/ case in mind) should allow a single file under net/ to cover the whole subsystem for all subtrees that don't have their own checkpatch.cfg, but will be overridden by files in subdirectories. So from a documentation point of view this could be done with the set as it is, with people just copying the "pervasive" and "line_len" commands from a "global" net/checkpatch.cfg setup down into the subtrees as they start dealing with exceptions. If we want something more automatic, it can certainly be extended,  this would just require checkpatch to parse all the upwards checkpatch.cfg files for each source file instead just taking the first found, which is what patch 6 implements. Also the command language in the config files is rather limited, maybe other commands maybe with more checkpatch additions would be useful to handle such scenarios.. Let me know what you think.. Thanks, Knut From 1584301603998122432@xxx Fri Nov 17 08:35:49 +0000 2017 X-GM-THRID: 1584245555255033826 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread