From: Joe Perches Date: Wed, 6 Aug 2014 23:10:33 +0000 (-0700) Subject: checkpatch: fix function pointers in blank line needed after declarations test X-Git-Tag: firefly_0821_release~176^2~3462^2~27 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=5a4e1fd37d0677755391e2e89e9386e072265157;p=firefly-linux-kernel-4.4.55.git checkpatch: fix function pointers in blank line needed after declarations test Add a function pointer declaration check to the test for blank line needed after declarations. Signed-off-by: Joe Perches Reported-by: Bruce W Allan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index cadf70f0201a..538105ae88b3 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2295,6 +2295,8 @@ sub process { if ($sline =~ /^\+\s+\S/ && #Not at char 1 # actual declarations ($prevline =~ /^\+\s+$Declare\s*$Ident\s*[=,;:\[]/ || + # function pointer declarations + $prevline =~ /^\+\s+$Declare\s*\(\s*\*\s*$Ident\s*\)\s*[=,;:\[\(]/ || # foo bar; where foo is some local typedef or #define $prevline =~ /^\+\s+$Ident(?:\s+|\s*\*\s*)$Ident\s*[=,;\[]/ || # known declaration macros @@ -2307,6 +2309,8 @@ sub process { $prevline =~ /(?:\{\s*|\\)$/) && # looks like a declaration !($sline =~ /^\+\s+$Declare\s*$Ident\s*[=,;:\[]/ || + # function pointer declarations + $sline =~ /^\+\s+$Declare\s*\(\s*\*\s*$Ident\s*\)\s*[=,;:\[\(]/ || # foo bar; where foo is some local typedef or #define $sline =~ /^\+\s+$Ident(?:\s+|\s*\*\s*)$Ident\s*[=,;\[]/ || # known declaration macros