aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2018-04-10 19:33:53 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2018-04-11 13:28:36 -0400
commitbc22d9a7d3aa76bc090d844e6aad18db9cc69237 (patch)
tree67bc89fa1631c1c0ddc2986a465850af2536a82e /scripts
parent8d2e11b22d79053e832d17084bc912102c6cbb62 (diff)
checkpatch: test SYMBOLIC_PERMS multiple times per line
There are occasions where symbolic perms are used in a ternary like return (channel == 0) ? S_IRUGO | S_IWUSR : S_IRUGO; The current test will find the first use "S_IRUGO | S_IWUSR" but not the second use "S_IRUGO" on the same line. Improve the test to look for all instances on a line. Link: http://lkml.kernel.org/r/1522127944.12357.49.camel@perches.com 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.pl2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 5fe361e1ed5e..d2464002bb40 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -6429,7 +6429,7 @@ sub process {
6429 } 6429 }
6430 6430
6431# check for uses of S_<PERMS> that could be octal for readability 6431# check for uses of S_<PERMS> that could be octal for readability
6432 if ($line =~ /\b($multi_mode_perms_string_search)\b/) { 6432 while ($line =~ m{\b($multi_mode_perms_string_search)\b}g) {
6433 my $oval = $1; 6433 my $oval = $1;
6434 my $octal = perms_to_octal($oval); 6434 my $octal = perms_to_octal($oval);
6435 if (WARN("SYMBOLIC_PERMS", 6435 if (WARN("SYMBOLIC_PERMS",