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.
Showing the changes to scripts/checkpatch.pl (1 of 1 file). Show all
Unified · Split
| @@ -6429,7 +6429,7 @@ sub process { · 6428 unmodified lines | ||
| 6429 | 6429 | } |
| 6430 | 6430 | |
| 6431 | 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 | 6433 | my $oval = $1; |
| 6434 | 6434 | my $octal = perms_to_octal($oval); |
| 6435 | 6435 | if (WARN("SYMBOLIC_PERMS", |