]> git.baikalelectronics.ru Git - kernel.git/commit
checkpatch: add --strict check for ifs with unnecessary parentheses
authorJoe Perches <joe@perches.com>
Fri, 8 Sep 2017 23:16:01 +0000 (16:16 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 9 Sep 2017 01:26:50 +0000 (18:26 -0700)
commitd75940e645cd21aae0ae62331eb36c395a1f9957
treefdcc058c6c373480df2e372de0a6e52ae7380a59
parentac511a1acb1aa357dae783a75b5b9b0513281fc7
checkpatch: add --strict check for ifs with unnecessary parentheses

An if statement test like
if ((foo == bar) && (baz != qux))
can arguably be better written without the parentheses as
if (foo == bar && baz != qux)

Add a test to find these cases.

Link: http://lkml.kernel.org/r/dcd0561ddd0fa43c51a420d53b550d738bf42001.1502734458.git.joe@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