Messages in this thread Patch in this message | | | From | Joe Perches <> | Subject | [PATCH 3/3] checkpatch: Improve test for no space after cast | Date | Wed, 15 Oct 2014 12:32:09 -0700 |
| |
sizeof(foo) is not a cast, allow a space after it.
Signed-off-by: Joe Perches <joe@perches.com> Tested-by: Kalle Valo <kvalo@qca.qualcomm.com> --- scripts/checkpatch.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 692fdb6..21dac46 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) { -- 2.1.0
| |