diff options
author | Joe Perches <joe@perches.com> | 2014-08-06 16:10:52 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-08-06 18:01:28 -0700 |
commit | f27c95db1176b41c6c87d9d3480d15efbca8f3ff (patch) | |
tree | cee0d9465e848c59d8b290b70a9b16e39d5d3b4c | |
parent | 1574a29f8e769998fe3e55eb6030dc61e3d09ccd (diff) | |
download | op-kernel-dev-f27c95db1176b41c6c87d9d3480d15efbca8f3ff.zip op-kernel-dev-f27c95db1176b41c6c87d9d3480d15efbca8f3ff.tar.gz |
checkpatch: improve "no space after cast" test
This --strict test previously worked only for what appeared to be cast
to pointer types.
Make it work for all casts.
Also, there's no reason to show the previous line for this type of
message, so don't.
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 | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 57a11d7..b351805 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2260,12 +2260,12 @@ sub process { } } - if ($line =~ /^\+.*\*[ \t]*\)[ \t]+(?!$Assignment|$Arithmetic)/) { + if ($line =~ /^\+.*\(\s*$Type\s*\)[ \t]+(?!$Assignment|$Arithmetic)/) { if (CHK("SPACING", - "No space is necessary after a cast\n" . $hereprev) && + "No space is necessary after a cast\n" . $herecurr) && $fix) { $fixed[$linenr - 1] =~ - s/^(\+.*\*[ \t]*\))[ \t]+/$1/; + s/(\(\s*$Type\s*\))[ \t]+/$1/; } } |