aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/checkpatch.pl4
1 files changed, 3 insertions, 1 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 33740404cd9e..4b9569fa931b 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3354,7 +3354,7 @@ sub process {
3354 } 3354 }
3355 3355
3356# Check relative indent for conditionals and blocks. 3356# Check relative indent for conditionals and blocks.
3357 if ($line =~ /\b(?:(?:if|while|for|(?:[a-z_]+|)for_each[a-z_]+)\s*\(|do\b)/ && $line !~ /^.\s*#/ && $line !~ /\}\s*while\s*/) { 3357 if ($line =~ /\b(?:(?:if|while|for|(?:[a-z_]+|)for_each[a-z_]+)\s*\(|(?:do|else)\b)/ && $line !~ /^.\s*#/ && $line !~ /\}\s*while\s*/) {
3358 ($stat, $cond, $line_nr_next, $remain_next, $off_next) = 3358 ($stat, $cond, $line_nr_next, $remain_next, $off_next) =
3359 ctx_statement_block($linenr, $realcnt, 0) 3359 ctx_statement_block($linenr, $realcnt, 0)
3360 if (!defined $stat); 3360 if (!defined $stat);
@@ -3446,6 +3446,8 @@ sub process {
3446 if ($check && $s ne '' && 3446 if ($check && $s ne '' &&
3447 (($sindent % 8) != 0 || 3447 (($sindent % 8) != 0 ||
3448 ($sindent < $indent) || 3448 ($sindent < $indent) ||
3449 ($sindent == $indent &&
3450 ($s !~ /^\s*(?:\}|\{|else\b)/)) ||
3449 ($sindent > $indent + 8))) { 3451 ($sindent > $indent + 8))) {
3450 WARN("SUSPECT_CODE_INDENT", 3452 WARN("SUSPECT_CODE_INDENT",
3451 "suspect code indent for conditional statements ($indent, $sindent)\n" . $herecurr . "$stat_real\n"); 3453 "suspect code indent for conditional statements ($indent, $sindent)\n" . $herecurr . "$stat_real\n");