Received: by 10.223.164.202 with SMTP id h10csp2326703wrb; Thu, 16 Nov 2017 13:15:00 -0800 (PST) X-Google-Smtp-Source: AGs4zMaPO3wT9fUd02u/8wOIQvw5/GzJN4OLOyLvPB+cpLUYy94xRp3z44CsGhS9QlgoIVPA+lhV X-Received: by 10.98.13.8 with SMTP id v8mr3258226pfi.180.1510866900713; Thu, 16 Nov 2017 13:15:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510866900; cv=none; d=google.com; s=arc-20160816; b=Anhu7aYwuyrhoPwpy7tHvlIU3bmL0m8l/AfSR5UME038LvYdO21c/Qm/OPZ+5/Izi3 244lo965h77e3SB+INwI+HyraqI1bsmQTs0dWqdXRX6QKKyEQrcEYn18s07rlXhRH8JY xTDqL+HlwstgU+QdUB8nem2K5kAzUSpOGxMr9J5gcaleKoEVpqOpcwjuaqE0GfGY9EXx cpcO7C9Bx7V/7dXjthKrqYgdvC09+7Nz45fsuxxCkOCSe0sgvtN0d3wVJ0q2rFzU4odE 2N3w7BasXIdYCaI4/7VPCIPcUnzB9KSLJGxaC478CzQV2TJXXvQBGtO6ObsxjNsDPDK+ ublA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=Zsp6QClQhRdCyRXH1gpJPaHkSpAzJLX4fhKmULH6K6Y=; b=t8H9nPI6cGLS5W0NyPzQStbp1OjA981OYRhiWzZ77bDryxu+dt46Id5Ww76+Lq5bF2 DcQFvkvLYBa33FlmWfPpumw1PXZE5g0nhneVLhGpPph3EW6GukSZ7/285y5QIRMszBwd cm81d11n/dS3r9LTZO3LPS3LVqs2+lshqbvlObjZ5Gm0vXFWs+488JI2OCDJLyI+KvoF Ou7Y2vpGtRLfbxCDapHDjuQVmOsTHKjy6BAfc42QVPa50sjnkj6D+BcpeucZEJtOb0Kf 1uD2WPP53a5u+tgqjeA2Xb8nkWV7uJEASPSpsdQjyLTGPEUS76rLszmBwjeJ7r/gcV/f j2Mw== 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 h192si1445226pgc.671.2017.11.16.13.14.47; Thu, 16 Nov 2017 13:15:00 -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 S965403AbdKPRDP (ORCPT + 92 others); Thu, 16 Nov 2017 12:03:15 -0500 Received: from aserp1040.oracle.com ([141.146.126.69]:50997 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936189AbdKPRCn (ORCPT ); Thu, 16 Nov 2017 12:02:43 -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 vAGH2e5m000928 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 16 Nov 2017 17:02:41 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 vAGH2edr017333 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 16 Nov 2017 17:02:40 GMT Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id vAGH2eTO018020; Thu, 16 Nov 2017 17:02:40 GMT Received: from abi.no.oracle.com (/10.172.144.123) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 16 Nov 2017 09:02:39 -0800 From: Knut Omang To: linux-kernel@vger.kernel.org Cc: Knut Omang , Jonathan Corbet , =?UTF-8?q?H=C3=A5kon=20Bugge?= , =?UTF-8?q?=C3=85smund=20=C3=98stvold?= , John Haxby , linux-doc@vger.kernel.org Subject: [PATCH 7/7] Documentation: Update checkpatch --ignore-cfg description Date: Thu, 16 Nov 2017 18:01:47 +0100 Message-Id: <92089503875f8aaa3911425dea2d9690bc541e85.1510840787.git-series.knut.omang@oracle.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: References: 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 When running checkpatch with --ignore-cfg it will now traverse the directories above the source file until a match is found. Reflect this enhanced behaviour in the documentation. Signed-off-by: Knut Omang --- Documentation/dev-tools/run-checkpatch.rst | 48 ++++++++++++----------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/Documentation/dev-tools/run-checkpatch.rst b/Documentation/dev-tools/run-checkpatch.rst index c72f818..566d8c6 100644 --- a/Documentation/dev-tools/run-checkpatch.rst +++ b/Documentation/dev-tools/run-checkpatch.rst @@ -26,17 +26,20 @@ number of challenges: This is the purpose of supplying the option ``--ignore-cfg checkpatch.cfg`` to ``scripts/checkpatch.pl``. It will then look for a file named ``checkpatch.cfg`` in the current directory or alternatively in the directory of the source -file. If that file exists, checkpatch parses a set of rules from it, and use -them to determine how to invoke checkpatch for a particular file. The kernel -Makefile system supports using this feature as an integrated part of compiling -the code. +file. If neither is found, and the file is within the kernel tree, checkpatch +will recursively look for a file with the same name in the directories above +until a file is found or the top of the tree is reached. + +If a match is found, checkpatch parses a set of rules from it, and use them to +determine how to invoke checkpatch for a particular file. The kernel Makefile +system supports using this feature as an integrated part of compiling the code. The ignore configuration file ----------------------------- The ignore configuration file can be used to set policies and "rein in" -checkpatch errors piece by piece for a particular subsystem or driver. -The the following syntax is supported:: +checkpatch errors piece by piece for a particular subsystem or driver. The the +following syntax is supported:: # comments line_len @@ -55,9 +58,9 @@ exceptions. Running checkpatch from make ---------------------------- -You can run checkpatch subject to rules defined in ``checkpatch.cfg`` in the -directory of the source file by using "make P=1" to run checkpatch on all files -that gets recompiled, or "make P=2" to run checkpatch on all source files. +You can run checkpatch subject to rules defined in the closest matching +``checkpatch.cfg`` file in the tree by using "make P=1" to run checkpatch on all +files that gets recompiled, or "make P=2" to run checkpatch on all source files. A make variable ``PF`` allows passing additional parameters to checkpatch.pl. You can for instance use:: @@ -70,15 +73,15 @@ selectively enabling of types of errors via changes to the local ``checkpatch.cfg``, and you can focus on fixing up errors subsystem or driver by driver on a type by type basis. -By default checkpatch will skip all files in directories without a -checkpatch.cfg file when invoked with the --ignore-cfg parameter. This is to -allow builds with P=2 to pass even for subsystems that has not yet done anything -to rein in checkpatch errors. At some point when all subsystems and drivers -either have fixed all checkpatch errors or added proper checkpatch.cfg files, -this can be changed. +When invoked with the --ignore-cfg parameter, by default checkpatch will skip +all files in directories without a matching checkpatch.cfg according to the +algorithm described above. This is to allow builds with P=2 to pass even for +subsystems that has not yet done anything to rein in checkpatch errors. At some +point when all subsystems and drivers either have fixed all checkpatch errors or +added proper checkpatch.cfg files, this can be changed. -To force checkpatch to run a full run in directories without a checkpatch.cfg -file as well, use:: +To force checkpatch to run a full run in directories without a +checkpatch.cfg file as well, use:: make P=2 PF="--req-ignore-cfg" @@ -96,10 +99,11 @@ with the -k option to ``make`` to let it continue upon errors. Ever tightening checkpatch rules -------------------------------- -Commit the changes to checkpatch.cfg together with the code changes that fixes a -particular type of issue, this will allow automatic checkpatch testing. This way -we can ensure that new errors of that particular type do not inadvertently sneak -in again! This can be done at any subsystem or module maintainer's discretion -and at the right time without having to do it all at the same time. +Commit the changes to the relevant checkpatch.cfg together with the code changes +that fixes a particular type of issue, this will allow automatic checkpatch +testing. This way we can ensure that new errors of that particular type do not +inadvertently sneak in again! This can be done at any subsystem or module +maintainer's discretion and at the right time without having to do it all at the +same time. Before submitting your changes, verify that "make P=2" passes with no errors. -- git-series 0.9.1 From 1583398936866587686@xxx Tue Nov 07 09:28:18 +0000 2017 X-GM-THRID: 1583398936866587686 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread