diff options
author | Joe Perches <joe@perches.com> | 2014-08-06 19:10:33 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-08-06 21:01:27 -0400 |
commit | 5a4e1fd37d0677755391e2e89e9386e072265157 (patch) | |
tree | e3c520b53f182569198c77fe8a22fa811d8c22af | |
parent | 356fd398135480363402cd334ac3218be56b7201 (diff) |
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 <joe@perches.com>
Reported-by: Bruce W Allan <bruce.w.allan@intel.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 | 4 |
1 files changed, 4 insertions, 0 deletions
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 { | |||
2295 | if ($sline =~ /^\+\s+\S/ && #Not at char 1 | 2295 | if ($sline =~ /^\+\s+\S/ && #Not at char 1 |
2296 | # actual declarations | 2296 | # actual declarations |
2297 | ($prevline =~ /^\+\s+$Declare\s*$Ident\s*[=,;:\[]/ || | 2297 | ($prevline =~ /^\+\s+$Declare\s*$Ident\s*[=,;:\[]/ || |
2298 | # function pointer declarations | ||
2299 | $prevline =~ /^\+\s+$Declare\s*\(\s*\*\s*$Ident\s*\)\s*[=,;:\[\(]/ || | ||
2298 | # foo bar; where foo is some local typedef or #define | 2300 | # foo bar; where foo is some local typedef or #define |
2299 | $prevline =~ /^\+\s+$Ident(?:\s+|\s*\*\s*)$Ident\s*[=,;\[]/ || | 2301 | $prevline =~ /^\+\s+$Ident(?:\s+|\s*\*\s*)$Ident\s*[=,;\[]/ || |
2300 | # known declaration macros | 2302 | # known declaration macros |
@@ -2307,6 +2309,8 @@ sub process { | |||
2307 | $prevline =~ /(?:\{\s*|\\)$/) && | 2309 | $prevline =~ /(?:\{\s*|\\)$/) && |
2308 | # looks like a declaration | 2310 | # looks like a declaration |
2309 | !($sline =~ /^\+\s+$Declare\s*$Ident\s*[=,;:\[]/ || | 2311 | !($sline =~ /^\+\s+$Declare\s*$Ident\s*[=,;:\[]/ || |
2312 | # function pointer declarations | ||
2313 | $sline =~ /^\+\s+$Declare\s*\(\s*\*\s*$Ident\s*\)\s*[=,;:\[\(]/ || | ||
2310 | # foo bar; where foo is some local typedef or #define | 2314 | # foo bar; where foo is some local typedef or #define |
2311 | $sline =~ /^\+\s+$Ident(?:\s+|\s*\*\s*)$Ident\s*[=,;\[]/ || | 2315 | $sline =~ /^\+\s+$Ident(?:\s+|\s*\*\s*)$Ident\s*[=,;\[]/ || |
2312 | # known declaration macros | 2316 | # known declaration macros |