]> git.baikalelectronics.ru Git - kernel.git/commit
checkpatch: add --fix option for some TRAILING_STATEMENTS
authorJoe Perches <joe@perches.com>
Wed, 23 Mar 2022 23:05:59 +0000 (16:05 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 24 Mar 2022 02:00:34 +0000 (19:00 -0700)
commit3f091e10a5b8e879a04a250963a3bac3e9557a1e
treef4e9a42e1c52e81b596cd14822f03b956aa0e588
parent7992ed53d904fc1615bcb67c454748712baefc0a
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: Linus Torvalds <torvalds@linux-foundation.org>
scripts/checkpatch.pl