diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index d440553a7e..2189db19f5 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2283,7 +2283,8 @@ sub process { #print "line<$line> prevline<$prevline> indent<$indent> sindent<$sindent> check<$check> continuation<$continuation> s<$s> cond_lines<$cond_lines> stat_real<$stat_real> stat<$stat>\n"; if ($check && (($sindent % 4) != 0 || - ($sindent <= $indent && $s ne ''))) { + ($sindent <= $indent && + $s !~ /^\s*(?:\}|\{|else\b)/))) { ERROR("suspect code indent for conditional statements ($indent, $sindent)\n" . $herecurr . "$stat_real\n"); } }