Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 048b123f authored by Rasmus Villemoes's avatar Rasmus Villemoes Committed by Linus Torvalds
Browse files

checkpatch.pl: also suggest 'else if' when if follows brace



This might help a kernel hacker think twice before blindly adding a
newline.

Signed-off-by: default avatarRasmus Villemoes <linux@rasmusvillemoes.dk>
Acked-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 29ee1b0c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3621,7 +3621,7 @@ sub process {
# if should not continue a brace
		if ($line =~ /}\s*if\b/) {
			ERROR("TRAILING_STATEMENTS",
			      "trailing statements should be on next line\n" .
			      "trailing statements should be on next line (or did you mean 'else if'?)\n" .
				$herecurr);
		}
# case and default should not have general statements after them