diff options
author | Joe Perches <joe@perches.com> | 2018-08-21 21:57:43 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-08-22 10:52:48 -0700 |
commit | 8c8c45cfdd5d8dd555da0d13c1d53b48f99ffe6f (patch) | |
tree | a931f49547096e80bd367f2d51e12eab2162db95 /scripts | |
parent | cd2614967d8b636911a39dd639aa5b87cf280945 (diff) | |
download | linux-8c8c45cfdd5d8dd555da0d13c1d53b48f99ffe6f.tar.bz2 |
checkpatch: fix macro argument reuse test
Multiple line macro definitions where the arguments are separated by line
continuations can cause checkpatch to emit invalid syntax regex tests.
This can occur when a single argument is modified in a part of a patch.
For example: (to not add a diff in the commit message)
$ ./scripts/checkpatch.pl --git db023296f0115d2fe01fdabad54678f2b806da23
Unterminated \g... pattern in regex; <very long regex omitted>
And, the test does not work correctly when these arguments are all new as
the initial patch line addition "+" is used in the argument name.
Fix this by stripping the line continuations and any "+" from the list of
arguments.
Link: http://lkml.kernel.org/r/86cdb43a4db70670c102020093f7fb4eb3003e01.camel@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>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/checkpatch.pl | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 022a77b98123..34e4683de7a3 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -4967,6 +4967,7 @@ sub process { if (defined $define_args && $define_args ne "") { $define_args = substr($define_args, 1, length($define_args) - 2); $define_args =~ s/\s*//g; + $define_args =~ s/\\\+?//g; @def_args = split(",", $define_args); } |