]> git.baikalelectronics.ru Git - kernel.git/commit
checkpatch: test SYMBOLIC_PERMS multiple times per line
authorJoe Perches <joe@perches.com>
Tue, 10 Apr 2018 23:33:53 +0000 (16:33 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 11 Apr 2018 17:28:36 +0000 (10:28 -0700)
commitf2a91ca8d7c8383c3e315abb452ded4125ea1740
tree67bc89fa1631c1c0ddc2986a465850af2536a82e
parent66ad9bf4fc2b2b5ce4d00b562b5e0e54109bb372
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>
scripts/checkpatch.pl