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 | 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 { · 6 unmodified lines | |||
| 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 |