Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1727cc70 authored by Joe Perches's avatar Joe Perches Committed by Linus Torvalds
Browse files

checkpatch: update octal permissions warning



When checking permissions, make sure 4 octal digits are used, but allow
a single 0 too.

Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent fbdb8138
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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);
				}
			}
		}