From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762920AbcINRva (ORCPT ); Wed, 14 Sep 2016 13:51:30 -0400 Received: from smtprelay0212.hostedemail.com ([216.40.44.212]:48501 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1762054AbcINRvZ (ORCPT ); Wed, 14 Sep 2016 13:51:25 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::,RULES_HIT:41:355:379:541:800:960:973:982:988:989:1260:1345:1437:1534:1541:1711:1730:1747:1777:1792:2393:2559:2562:3138:3139:3140:3141:3142:3353:3653:3865:3867:3868:3870:3871:3872:3874:4321:5007:6261:6299:7903:8957:9040:9163:10004:10848:11658:11914:12555:13069:13311:13357:14181:14384:14394:14721:21080:21451:30012:30054:30070,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:3,LUA_SUMMARY:none X-HE-Tag: cream99_457a80314c750 X-Filterd-Recvd-Size: 2498 From: Joe Perches To: Andrew Morton , Andy Whitcroft Cc: Greg KH , Jonathan Corbet , Josh Triplett , Christian Borntraeger , "Theodore Ts'o" , linux-kernel@vger.kernel.org Subject: [PATCH] checkpatch: Minimize checkpatch induced patches... Date: Wed, 14 Sep 2016 10:51:15 -0700 Message-Id: X-Mailer: git-send-email 2.10.0.rc2.1.g053435c Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org checkpatch can be a useful tool for patches. It can be a much more controversial tool when used on files with the -f option for style and whitespace changes for code that is relatively stable, obsolete, or for maintained by specific individuals. o By default, allow checkpatch to be used with the -f|--file option for files in drivers/staging/ o Add an undocumented --force command line option to be used together with the -f|--file option to scan any file Signed-off-by: Joe Perches cc: Greg KH cc: Jonathan Corbet cc: Josh Triplett cc: Christian Borntraeger cc: Theodore Ts'o --- scripts/checkpatch.pl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 0ef3d83..d998a61 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -27,6 +27,7 @@ my $emacs = 0; my $terse = 0; my $showfile = 0; my $file = 0; +my $force = 0; my $git = 0; my %git_commits = (); my $check = 0; @@ -188,6 +189,7 @@ GetOptions( 'terse!' => \$terse, 'showfile!' => \$showfile, 'f|file!' => \$file, + 'force!' => \$force, 'g|git!' => \$git, 'subjective!' => \$check, 'strict!' => \$check, @@ -893,6 +895,10 @@ if ($git) { my $vname; for my $filename (@ARGV) { my $FILE; + if (!$force && $file && $filename !~ m@^drivers/staging/@) { + warn "$P: checking '$filename' is not supported\n"; + next; + } if ($git) { open($FILE, '-|', "git format-patch -M --stdout -1 $filename") || die "$P: $filename: git format-patch failed - $!\n"; -- 2.10.0.rc2.1.g053435c