Skip to content

Commit

Permalink
checkpatch: Update alignment check
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Joe Perches authored and Linus Torvalds committed Jul 31, 2012
1 parent 4ed940d commit b34a26f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/checkpatch.pl
Original file line number Diff line number Diff line change
Expand Up @@ -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) .
Expand Down

0 comments on commit b34a26f

Please sign in to comment.