Add a function pointer declaration check to the test for blank line needed after declarations.
Showing the changes to scripts/checkpatch.pl (1 of 1 file). Show all
Unified · Split
| @@ -2295,6 +2295,8 @@ sub process { · 2294 unmodified lines | ||
| 2295 | 2295 | if ($sline =~ /^\+\s+\S/ && #Not at char 1 |
| 2296 | 2296 | # actual declarations |
| 2297 | 2297 | ($prevline =~ /^\+\s+$Declare\s*$Ident\s*[=,;:\[]/ || |
| 2298 | + # function pointer declarations | |
| 2299 | + $prevline =~ /^\+\s+$Declare\s*\(\s*\*\s*$Ident\s*\)\s*[=,;:\[\(]/ || | |
| 2298 | 2300 | # foo bar; where foo is some local typedef or #define |
| 2299 | 2301 | $prevline =~ /^\+\s+$Ident(?:\s+|\s*\*\s*)$Ident\s*[=,;\[]/ || |
| 2300 | 2302 | # known declaration macros |
| @@ -2307,6 +2309,8 @@ sub process { · 6 unmodified lines | ||
| 2307 | 2309 | $prevline =~ /(?:\{\s*|\\)$/) && |
| 2308 | 2310 | # looks like a declaration |
| 2309 | 2311 | !($sline =~ /^\+\s+$Declare\s*$Ident\s*[=,;:\[]/ || |
| 2312 | + # function pointer declarations | |
| 2313 | + $sline =~ /^\+\s+$Declare\s*\(\s*\*\s*$Ident\s*\)\s*[=,;:\[\(]/ || | |
| 2310 | 2314 | # foo bar; where foo is some local typedef or #define |
| 2311 | 2315 | $sline =~ /^\+\s+$Ident(?:\s+|\s*\*\s*)$Ident\s*[=,;\[]/ || |
| 2312 | 2316 | # known declaration macros |