Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1660126

[PATCH] checkpatch: Fix stepping through statements with $stat and ctx_statement_block

From Joe Perches <joe@perches.com>
Newsgroups linux.kernel
Subject [PATCH] checkpatch: Fix stepping through statements with $stat and ctx_statement_block
Date 2017-06-07 21:20 +0200
Message-ID <tPOEN-2je-5@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


Fix the off-by-one in the suppression of lines in a statement block.

This means that for multiple line statements like

	foo(bar,
	    baz,
	    qux);

$stat has been inspected first correctly for the entire statement,
and subsequently incorrectly just for

	    qux);

This fix will help make tracking appropriate indentation a little easier.

Signed-off-by: Joe Perches <joe@perches.com>
---
 scripts/checkpatch.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 7fcaf5ca997b..05c819093cc0 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3219,7 +3219,7 @@ sub process {
 		my ($stat, $cond, $line_nr_next, $remain_next, $off_next,
 		    $realline_next);
 #print "LINE<$line>\n";
-		if ($linenr >= $suppress_statement &&
+		if ($linenr > $suppress_statement &&
 		    $realcnt && $sline =~ /.\s*\S/) {
 			($stat, $cond, $line_nr_next, $remain_next, $off_next) =
 				ctx_statement_block($linenr, $realcnt, 0);
-- 
2.10.0.rc2.1.g053435c

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH] checkpatch: Fix stepping through statements with $stat and ctx_statement_block Joe Perches <joe@perches.com> - 2017-06-07 21:20 +0200

csiph-web