From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762154AbcINR5K (ORCPT ); Wed, 14 Sep 2016 13:57:10 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:36057 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753801AbcINR5I (ORCPT ); Wed, 14 Sep 2016 13:57:08 -0400 X-IBM-Helo: d06dlp02.portsmouth.uk.ibm.com X-IBM-MailFrom: borntraeger@de.ibm.com X-IBM-RcptTo: linux-kernel@vger.kernel.org Subject: Re: [PATCH] checkpatch: Minimize checkpatch induced patches... To: Joe Perches , Andrew Morton , Andy Whitcroft References: Cc: Greg KH , Jonathan Corbet , Josh Triplett , "Theodore Ts'o" , linux-kernel@vger.kernel.org From: Christian Borntraeger Date: Wed, 14 Sep 2016 19:56:55 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16091417-0036-0000-0000-0000022AC78D X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16091417-0037-0000-0000-000012778BB9 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-09-14_08:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609020000 definitions=main-1609140239 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/14/2016 07:51 PM, Joe Perches wrote: > 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 This will certainly help to reduce the noise. On the other hand I remember Linus saying something along the line that he does not like the -f parameter (and he prefers to set this automatically). So while I like the approach I am not happy enough to ack right now - still looking for a better alternative :-/ > --- > 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"; >