From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965090AbbJ2Nqu (ORCPT ); Thu, 29 Oct 2015 09:46:50 -0400 Received: from smtprelay0063.hostedemail.com ([216.40.44.63]:49093 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932088AbbJ2Nqt (ORCPT ); Thu, 29 Oct 2015 09:46:49 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::,RULES_HIT:41:355:379:541:599:800:960:968:973:982:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2828:3138:3139:3140:3141:3142:3352:3622:3653:3865:3867:3868:3870:3871:3872:3873:3874:4321:4362:5007:6261:6299:7903:9163:10004:10400:10848:11232:11658:11914:12043:12517:12519:12555:12740:13019:13069:13311:13357:21080:30029:30054:30091,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:2,LUA_SUMMARY:none X-HE-Tag: gun20_3b54f4b075407 X-Filterd-Recvd-Size: 2207 Message-ID: <1446126406.2757.160.camel@perches.com> Subject: Re: [PATCH] scripts: checkpatch: remove preceding dot-slash from path name From: Joe Perches To: Christian Gromm Cc: Andy Whitcroft , Andrew Morton , linux-kernel@vger.kernel.org Date: Thu, 29 Oct 2015 06:46:46 -0700 In-Reply-To: <1446124009-26947-1-git-send-email-christian.gromm@microchip.com> References: <1446124009-26947-1-git-send-email-christian.gromm@microchip.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.12.11-0ubuntu3 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2015-10-29 at 14:06 +0100, Christian Gromm wrote: > In case checkpatch is called with a path name that starts with ./ for > the current directory not all issues are being reported since internal > path checks don't succeed. This patch removes the leading './' from > $filename. This is needed to have checkpatch report all issues found > during execution. > > Signed-off-by: Christian Gromm > --- > scripts/checkpatch.pl | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl > index f2a1131..44435fd 100755 > --- a/scripts/checkpatch.pl > +++ b/scripts/checkpatch.pl > @@ -730,6 +730,9 @@ my $fixlinenr = -1; > my $vname; > for my $filename (@ARGV) { > my $FILE; > + if ($filename =~ /^(\.\/)/) { > + substr($filename, 0, 2) = ""; > + } If you are going to attempt to do pathname translations, please do it comprehensively using something like realpath. $ cd $ cd drivers/staging $ checkpatch.pl -f ./ And it should be done for the files contained in a patch too. thanks. > if ($file) { > open($FILE, '-|', "diff -u /dev/null $filename") || > die "$P: $filename: diff failed - $!\n";