diff options
author | Joe Perches <joe@perches.com> | 2017-07-10 18:52:30 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-07-10 19:32:35 -0400 |
commit | fd71f6326844efac98d99c0c34e7ca7419506b15 (patch) | |
tree | 311caa31f03c8eca5a14c2d4a5ced67985d604e3 | |
parent | 7fe528a27dee5fcab3bc093ee6f311080f799e29 (diff) |
checkpatch: improve multi-line alignment test
The current test fails to warn about improper alignment with code like
foo->bar = func(arg1,
arg2);
because foo->bar is not a single identifier.
Convert the $Ident to $Lval which allows for multiple dereferences.
Link: http://lkml.kernel.org/r/01c35b9b6a12a415e57746d45d589bfaad39952a.1498841563.git.joe@perches.com
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rwxr-xr-x | scripts/checkpatch.pl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 43171ed88115..8f940c09918f 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
@@ -2993,7 +2993,7 @@ sub process { | |||
2993 | 2993 | ||
2994 | # check multi-line statement indentation matches previous line | 2994 | # check multi-line statement indentation matches previous line |
2995 | if ($^V && $^V ge 5.10.0 && | 2995 | if ($^V && $^V ge 5.10.0 && |
2996 | $prevline =~ /^\+([ \t]*)((?:$c90_Keywords(?:\s+if)\s*)|(?:$Declare\s*)?(?:$Ident|\(\s*\*\s*$Ident\s*\))\s*|$Ident\s*=\s*$Ident\s*)\(.*(\&\&|\|\||,)\s*$/) { | 2996 | $prevline =~ /^\+([ \t]*)((?:$c90_Keywords(?:\s+if)\s*)|(?:$Declare\s*)?(?:$Ident|\(\s*\*\s*$Ident\s*\))\s*|(?:\*\s*)*$Lval\s*=\s*$Ident\s*)\(.*(\&\&|\|\||,)\s*$/) { |
2997 | $prevline =~ /^\+(\t*)(.*)$/; | 2997 | $prevline =~ /^\+(\t*)(.*)$/; |
2998 | my $oldindent = $1; | 2998 | my $oldindent = $1; |
2999 | my $rest = $2; | 2999 | my $rest = $2; |