]> git.baikalelectronics.ru Git - kernel.git/commit
checkpatch: fix macro argument reuse test
authorJoe Perches <joe@perches.com>
Wed, 22 Aug 2018 04:57:43 +0000 (21:57 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 22 Aug 2018 17:52:48 +0000 (10:52 -0700)
commit285aaf9eb91e5522e2ba5a66f7cc3002c1d6f75c
treea931f49547096e80bd367f2d51e12eab2162db95
parentb8584f0456b021ab17e5f498c2d8fef1828c2fd6
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 2dfe4e9e42048c7fbde90d46c8c2ba4e6508e6bb
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>
scripts/checkpatch.pl