checkpatch: add --fix option for some TRAILING_STATEMENTS
authorJoe Perches <joe@perches.com>
Mon, 28 Feb 2022 23:02:15 +0000 (10:02 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 28 Feb 2022 23:02:15 +0000 (10:02 +1100)
commit907b245c79e1e0b1bf55c0a90f46b8fa91d494e2
tree2da3390bc3a370d8f830f848040c72c44ae05180
parent0c69d2304e380af1d86c69395718fac8cb135e4b
checkpatch: add --fix option for some TRAILING_STATEMENTS

Single line code like:

if (foo) bar;

should generally be written:

if (foo)
bar;

Add a --fix test to do so.

This fix is not done when an ASSIGN_IN_IF in the same line exists.

Link: https://lkml.kernel.org/r/20220128185924.80137-2-joe@perches.com
Signed-off-by: Joe Perches <joe@perches.com>
Cc: Dwaipayan Ray <dwaipayanray1@gmail.com>
Cc: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
scripts/checkpatch.pl