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: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Acked-by: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Rasmus Villemoes 2014-08-06 16:10:37 -07:00 коммит произвёл Linus Torvalds
Родитель 29ee1b0c67
Коммит 048b123fad
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -3621,7 +3621,7 @@ sub process {
# if should not continue a brace # if should not continue a brace
if ($line =~ /}\s*if\b/) { if ($line =~ /}\s*if\b/) {
ERROR("TRAILING_STATEMENTS", 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); $herecurr);
} }
# case and default should not have general statements after them # case and default should not have general statements after them