summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2014-04-03 23:49:15 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2014-04-04 01:21:13 +0200
commit1727cc70451017e6d9c0129681792c18f166af75 (patch)
treeb09810ebd74791d336091cfb63d714d42655ec73 /scripts
parentcheckpatch: warn on uses of __constant_<foo> functions (diff)
downloadlinux-1727cc70451017e6d9c0129681792c18f166af75.tar.xz
linux-1727cc70451017e6d9c0129681792c18f166af75.zip
checkpatch: update octal permissions warning
When checking permissions, make sure 4 octal digits are used, but allow a single 0 too. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/checkpatch.pl6
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 1054283c6e70..9f12213d81cf 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -4512,9 +4512,11 @@ sub process {
my $val = $1;
$val = $6 if ($skip_args ne "");
- if ($val =~ /^$Int$/ && $val !~ /^$Octal$/) {
+ if ($val !~ /^0$/ &&
+ (($val =~ /^$Int$/ && $val !~ /^$Octal$/) ||
+ length($val) ne 4)) {
ERROR("NON_OCTAL_PERMISSIONS",
- "Use octal not decimal permissions\n" . $herecurr);
+ "Use 4 digit octal (0777) not decimal permissions\n" . $herecurr);
}
}
}