From 04941aa774320eb0118339c8cd11d7f1321e74d3 Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Wed, 10 Dec 2014 15:51:37 -0800 Subject: checkpatch: improve test for no space after cast sizeof(foo) is not a cast, allow a space after it. Signed-off-by: Joe Perches Tested-by: Kalle Valo Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- scripts/checkpatch.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 8a577aa..d94f5d8 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2515,7 +2515,8 @@ sub process { } } - if ($line =~ /^\+.*\(\s*$Type\s*\)[ \t]+(?!$Assignment|$Arithmetic|{)/) { + if ($line =~ /^\+.*(\w+\s*)?\(\s*$Type\s*\)[ \t]+(?!$Assignment|$Arithmetic|[,;\({\[\<\>])/ && + (!defined($1) || $1 !~ /sizeof\s*/)) { if (CHK("SPACING", "No space is necessary after a cast\n" . $herecurr) && $fix) { -- cgit v1.1