diff options
| author | Joe Perches <joe@perches.com> | 2014-04-03 17:49:15 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-03 19:21:13 -0400 |
| commit | 1727cc70451017e6d9c0129681792c18f166af75 (patch) | |
| tree | b09810ebd74791d336091cfb63d714d42655ec73 /scripts | |
| parent | fbdb8138cf0c75a0cf21991ca05ecc9fdff6e070 (diff) | |
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-x | scripts/checkpatch.pl | 6 |
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 { | |||
| 4512 | my $val = $1; | 4512 | my $val = $1; |
| 4513 | $val = $6 if ($skip_args ne ""); | 4513 | $val = $6 if ($skip_args ne ""); |
| 4514 | 4514 | ||
| 4515 | if ($val =~ /^$Int$/ && $val !~ /^$Octal$/) { | 4515 | if ($val !~ /^0$/ && |
| 4516 | (($val =~ /^$Int$/ && $val !~ /^$Octal$/) || | ||
| 4517 | length($val) ne 4)) { | ||
| 4516 | ERROR("NON_OCTAL_PERMISSIONS", | 4518 | ERROR("NON_OCTAL_PERMISSIONS", |
| 4517 | "Use octal not decimal permissions\n" . $herecurr); | 4519 | "Use 4 digit octal (0777) not decimal permissions\n" . $herecurr); |
| 4518 | } | 4520 | } |
| 4519 | } | 4521 | } |
| 4520 | } | 4522 | } |
