checkpatch: Update alignment check
authorJoe Perches <joe@perches.com>
Mon, 30 Jul 2012 21:41:16 +0000 (14:41 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 31 Jul 2012 00:25:17 +0000 (17:25 -0700)
Parenthesis alignment doesn't correctly check an existing line after an
inserted or modified line with an open parenthesis.

Fix it.

Signed-off-by: Joe Perches <joe@perches.com>
Cc: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
scripts/checkpatch.pl

index e5bd60f..630319a 100755 (executable)
@@ -1848,8 +1848,8 @@ sub process {
 
                        my $pos = pos_last_openparen($rest);
                        if ($pos >= 0) {
-                               $line =~ /^\+([ \t]*)/;
-                               my $newindent = $1;
+                               $line =~ /^(\+| )([ \t]*)/;
+                               my $newindent = $2;
 
                                my $goodtabindent = $oldindent .
                                        "\t" x ($pos / 8) .