checkpatch: add --fix option for some TRAILING_STATEMENTS
authorJoe Perches <joe@perches.com>
Wed, 16 Feb 2022 04:31:53 +0000 (15:31 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 17 Feb 2022 03:46:52 +0000 (14:46 +1100)
commit01587a2f1ff9b34275553bf2d08c44b62c9256ae
treedef1ef8742c833a21e1c35bda525067c5812cfe7
parent078d8c5d5b0c7de9332fd5fae64de38b3ca00f36
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