The patch titled Subject: checkpatch: test SYMBOLIC_PERMS multiple times per line has been added to the -mm tree. Its filename is checkpatch-test-symbolic_perms-multiple-times-per-line.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/checkpatch-test-symbolic_perms-multiple-times-per-line.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/checkpatch-test-symbolic_perms-multiple-times-per-line.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Joe Perches <joe@xxxxxxxxxxx> Subject: 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@xxxxxxxxxxx Signed-off-by: Joe Perches <joe@xxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff -puN scripts/checkpatch.pl~checkpatch-test-symbolic_perms-multiple-times-per-line scripts/checkpatch.pl --- a/scripts/checkpatch.pl~checkpatch-test-symbolic_perms-multiple-times-per-line +++ a/scripts/checkpatch.pl @@ -6442,7 +6442,7 @@ sub process { } # check for uses of S_<PERMS> that could be octal for readability - if ($line =~ /\b($multi_mode_perms_string_search)\b/) { + while ($line =~ m{\b($multi_mode_perms_string_search)\b}g) { my $oval = $1; my $octal = perms_to_octal($oval); if (WARN("SYMBOLIC_PERMS", _ Patches currently in -mm which might be from joe@xxxxxxxxxxx are checkpatch-improve-parse_email-signature-checking.patch checkpatch-improve-get_quoted_string-for-trace_event-macros.patch checkpatch-test-symbolic_perms-multiple-times-per-line.patch maintainers-update-bouncing-aacraid-adapteccom-addresses.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html