From 932329b8b574916533763032f0766452144dcb35 Mon Sep 17 00:00:00 2001 From: Andy Whitcroft Date: Wed, 15 Oct 2008 22:02:34 -0700 Subject: [PATCH] --- yaml --- r: 114782 b: refs/heads/master c: bb44ad39c886401e1ffe0876565f8b3fcea64e9d h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/scripts/checkpatch.pl | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 3329aaba2dbe..d54a721cfcb7 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 480120586464e5a8cd2289a90ffbb5c042e66ba0 +refs/heads/master: bb44ad39c886401e1ffe0876565f8b3fcea64e9d diff --git a/trunk/scripts/checkpatch.pl b/trunk/scripts/checkpatch.pl index a675f067b572..2c1afba57580 100755 --- a/trunk/scripts/checkpatch.pl +++ b/trunk/scripts/checkpatch.pl @@ -2001,7 +2001,16 @@ sub process { if (length($c) && $s !~ /^\s*{?\s*\\*\s*$/ && $c !~ /}\s*while\s*/) { - ERROR("trailing statements should be on next line\n" . $herecurr); + # Find out how long the conditional actually is. + my @newlines = ($c =~ /\n/gs); + my $cond_lines = 1 + $#newlines; + + my $stat_real = raw_line($linenr, $cond_lines); + if (defined($stat_real) && $cond_lines > 1) { + $stat_real = "[...]\n$stat_real"; + } + + ERROR("trailing statements should be on next line\n" . $herecurr . $stat_real); } }