]> git.baikalelectronics.ru Git - kernel.git/commit
checkpatch: try to avoid mask and shift errors
authorJoe Perches <joe@perches.com>
Wed, 10 Dec 2014 23:51:46 +0000 (15:51 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 11 Dec 2014 01:41:11 +0000 (17:41 -0800)
commitbfbf47f75e62485978629d10ba0f6e4d09e39f20
treeeed4ba0882422e17763c65ceef9ce66d11bf79bc
parent3cb8430fd82283e14dea8bc713c3ecbb31a669a5
checkpatch: try to avoid mask and shift errors

Shift has a higher precedence that mask so warn when a mask then shift
operation is done without parentheses around the mask.

This test works well for a right shift, but the left shift is pretty
commonly done correctly so only warn on the right shift.

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