From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751988AbdLJOEJ (ORCPT ); Sun, 10 Dec 2017 09:04:09 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:41214 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751499AbdLJOEG (ORCPT ); Sun, 10 Dec 2017 09:04:06 -0500 X-Google-Smtp-Source: AGs4zMZQfcgi63nHswDG6DTdAN12OsX9r8MISmUdPNvUPEHw4uwFW2pneVeRULmOxUSi/hGVmzb7oQ== From: Bartosz Golaszewski To: Andy Whitcroft , Joe Perches , Andy Shevchenko Cc: linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH] checkpatch: don't require octal permissions for "0" Date: Sun, 10 Dec 2017 15:04:01 +0100 Message-Id: <20171210140401.7698-1-brgl@bgdev.pl> X-Mailer: git-send-email 2.15.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); -- 2.15.1