History

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.

Joe Perches committed 12 years ago

Commit 5a4e1fd1 parent 356fd391 file · +4 −0Browse files

Showing the changes to scripts/checkpatch.pl (1 of 1 file). Show all

Unified · Split

scripts/checkpatch.pl+4−0
@@ -2295,6 +2295,8 @@ sub process { · 2294 unmodified lines
22952295 if ($sline =~ /^\+\s+\S/ && #Not at char 1
22962296 # actual declarations
22972297 ($prevline =~ /^\+\s+$Declare\s*$Ident\s*[=,;:\[]/ ||
2298+ # function pointer declarations
2299+ $prevline =~ /^\+\s+$Declare\s*\(\s*\*\s*$Ident\s*\)\s*[=,;:\[\(]/ ||
22982300 # foo bar; where foo is some local typedef or #define
22992301 $prevline =~ /^\+\s+$Ident(?:\s+|\s*\*\s*)$Ident\s*[=,;\[]/ ||
23002302 # known declaration macros
@@ -2307,6 +2309,8 @@ sub process { · 6 unmodified lines
23072309 $prevline =~ /(?:\{\s*|\\)$/) &&
23082310 # looks like a declaration
23092311 !($sline =~ /^\+\s+$Declare\s*$Ident\s*[=,;:\[]/ ||
2312+ # function pointer declarations
2313+ $sline =~ /^\+\s+$Declare\s*\(\s*\*\s*$Ident\s*\)\s*[=,;:\[\(]/ ||
23102314 # foo bar; where foo is some local typedef or #define
23112315 $sline =~ /^\+\s+$Ident(?:\s+|\s*\*\s*)$Ident\s*[=,;\[]/ ||
23122316 # known declaration macros