aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2015-02-13 17:38:52 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2015-02-14 00:21:40 -0500
commit43f7fe52a82ec9f7aa6420af430745111674c7b9 (patch)
tree8b4693efd347c405cc2063d1fe570385f1ee57c8 /scripts
parentcaac1d5fddf2d55e1e1fd6d86f6fc178c801e286 (diff)
checkpatch: improve "no space necessary after cast" test
Code like: if (a < sizeof(<type>) && and { .len = sizeof(<type>) }, incorrectly emits that warning, so add more exceptions to avoid the warning. 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-xscripts/checkpatch.pl2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 7f1804e052f2..a9baaabfae36 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2541,7 +2541,7 @@ sub process {
2541 } 2541 }
2542 } 2542 }
2543 2543
2544 if ($line =~ /^\+.*(\w+\s*)?\(\s*$Type\s*\)[ \t]+(?!$Assignment|$Arithmetic|[,;\({\[\<\>])/ && 2544 if ($line =~ /^\+.*(\w+\s*)?\(\s*$Type\s*\)[ \t]+(?!$Assignment|$Arithmetic|[,;:\?\(\{\}\[\<\>]|&&|\|\||\\$)/ &&
2545 (!defined($1) || $1 !~ /sizeof\s*/)) { 2545 (!defined($1) || $1 !~ /sizeof\s*/)) {
2546 if (CHK("SPACING", 2546 if (CHK("SPACING",
2547 "No space is necessary after a cast\n" . $herecurr) && 2547 "No space is necessary after a cast\n" . $herecurr) &&