diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/checkpatch.pl | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index a675f067b572..2c1afba57580 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
@@ -2001,7 +2001,16 @@ sub process { | |||
2001 | if (length($c) && $s !~ /^\s*{?\s*\\*\s*$/ && | 2001 | if (length($c) && $s !~ /^\s*{?\s*\\*\s*$/ && |
2002 | $c !~ /}\s*while\s*/) | 2002 | $c !~ /}\s*while\s*/) |
2003 | { | 2003 | { |
2004 | ERROR("trailing statements should be on next line\n" . $herecurr); | 2004 | # Find out how long the conditional actually is. |
2005 | my @newlines = ($c =~ /\n/gs); | ||
2006 | my $cond_lines = 1 + $#newlines; | ||
2007 | |||
2008 | my $stat_real = raw_line($linenr, $cond_lines); | ||
2009 | if (defined($stat_real) && $cond_lines > 1) { | ||
2010 | $stat_real = "[...]\n$stat_real"; | ||
2011 | } | ||
2012 | |||
2013 | ERROR("trailing statements should be on next line\n" . $herecurr . $stat_real); | ||
2005 | } | 2014 | } |
2006 | } | 2015 | } |
2007 | 2016 | ||