From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752265AbdLKCTI (ORCPT ); Sun, 10 Dec 2017 21:19:08 -0500 Received: from smtprelay0084.hostedemail.com ([216.40.44.84]:51279 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751637AbdLKCTH (ORCPT ); Sun, 10 Dec 2017 21:19:07 -0500 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::,RULES_HIT:41:355:379:541:599:800:960:973:982:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1431:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2197:2199:2393:2559:2562:2828:3138:3139:3140:3141:3142:3353:3622:3653:3865:3866:3871:4321:4605:5007:7514:10004:10400:10848:11026:11232:11473:11657:11658:11914:12043:12438:12555:12740:12760:12895:13069:13311:13357:13439:14181:14659:14721:21080:21221:21451:21627:30054:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: fog15_6c6bf0620bd5c X-Filterd-Recvd-Size: 2471 Message-ID: <1512958743.26342.32.camel@perches.com> Subject: Re: [PATCH] checkpatch: don't require octal permissions for "0" From: Joe Perches To: Bartosz Golaszewski , Andy Whitcroft , Andy Shevchenko Cc: linux-kernel@vger.kernel.org Date: Sun, 10 Dec 2017 18:19:03 -0800 In-Reply-To: <20171210140401.7698-1-brgl@bgdev.pl> References: <20171210140401.7698-1-brgl@bgdev.pl> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.26.1-1 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 Sun, 2017-12-10 at 15:04 +0100, Bartosz Golaszewski wrote: > If the permission value is 0, don't raise the NON_OCTAL_PERMISSIONS > error. There's no possibility of an error if there are no permissions. > > Suggested-by: Andy Shevchenko > Signed-off-by: Bartosz Golaszewski > --- > scripts/checkpatch.pl | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl > index 6b130a4116fa..ea98e298d3ac 100755 > --- a/scripts/checkpatch.pl > +++ b/scripts/checkpatch.pl > @@ -6321,7 +6321,7 @@ sub process { > if ($stat =~ /$test/) { > my $val = $1; > $val = $6 if ($skip_args ne ""); > - if (($val =~ /^$Int$/ && $val !~ /^$Octal$/) || > + if (($val ne "0" && $val =~ /^$Int$/ && $val !~ /^$Octal$/) || > ($val =~ /^$Octal$/ && length($val) ne 4)) { > ERROR("NON_OCTAL_PERMISSIONS", > "Use 4 digit octal (0777) not decimal permissions\n" . "$here\n" . $stat_real); perhaps --- diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 6b130a4116fa..950bbc0e6e3f 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -6321,7 +6321,8 @@ sub process { if ($stat =~ /$test/) { my $val = $1; $val = $6 if ($skip_args ne ""); - if (($val =~ /^$Int$/ && $val !~ /^$Octal$/) || + if ($func !~ /^module_param/ && + ($val =~ /^$Int$/ && $val !~ /^$Octal$/) || ($val =~ /^$Octal$/ && length($val) ne 4)) { ERROR("NON_OCTAL_PERMISSIONS", "Use 4 digit octal (0777) not decimal permissions\n" . "$here\n" . $stat_real);