Commit 5a4e1fd3 authored by Joe Perches's avatar Joe Perches Committed by Linus Torvalds

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: default avatarJoe Perches <joe@perches.com>
Reported-by: default avatarBruce W Allan <bruce.w.allan@intel.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 356fd398
...@@ -2295,6 +2295,8 @@ sub process { ...@@ -2295,6 +2295,8 @@ sub process {
if ($sline =~ /^\+\s+\S/ && #Not at char 1 if ($sline =~ /^\+\s+\S/ && #Not at char 1
# actual declarations # actual declarations
($prevline =~ /^\+\s+$Declare\s*$Ident\s*[=,;:\[]/ || ($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 # foo bar; where foo is some local typedef or #define
$prevline =~ /^\+\s+$Ident(?:\s+|\s*\*\s*)$Ident\s*[=,;\[]/ || $prevline =~ /^\+\s+$Ident(?:\s+|\s*\*\s*)$Ident\s*[=,;\[]/ ||
# known declaration macros # known declaration macros
...@@ -2307,6 +2309,8 @@ sub process { ...@@ -2307,6 +2309,8 @@ sub process {
$prevline =~ /(?:\{\s*|\\)$/) && $prevline =~ /(?:\{\s*|\\)$/) &&
# looks like a declaration # looks like a declaration
!($sline =~ /^\+\s+$Declare\s*$Ident\s*[=,;:\[]/ || !($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 # foo bar; where foo is some local typedef or #define
$sline =~ /^\+\s+$Ident(?:\s+|\s*\*\s*)$Ident\s*[=,;\[]/ || $sline =~ /^\+\s+$Ident(?:\s+|\s*\*\s*)$Ident\s*[=,;\[]/ ||
# known declaration macros # known declaration macros
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment