* [PATCH] checkpatch: Fix function pointers in blank line needed after declarations test
[not found] ` <804857E1F29AAC47BF68C404FC60A184656254DF@ORSMSX105.amr.corp.intel.com>
@ 2014-06-06 18:33 ` Joe Perches
0 siblings, 0 replies; only message in thread
From: Joe Perches @ 2014-06-06 18:33 UTC (permalink / raw)
To: Andrew Morton; +Cc: Allan, Bruce W, LKML, Andy Whitcroft
Add a function pointer declaration check to the
test for blank line needed after declarations.
Reported-by: Bruce W Allan <bruce.w.allan@intel.com>
Signed-off-by: Joe Perches <joe@perches.com>
---
On Fri, 2014-06-06 at 17:23 +0000, Allan, Bruce W wrote:
> > WARNING: Missing a blank line after declarations
> > #318: FILE: drivers/crypto/qat/qat_common/adf_accel_devices.h:140:
> > + struct adf_hw_device_class *dev_class;
> > + uint32_t (*get_accel_mask)(uint32_t fuse);
>
> This one is a false positive from checkpatch
scripts/checkpatch.pl | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 010b18e..f4b8911 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2295,6 +2295,8 @@ sub process {
if ($sline =~ /^\+\s+\S/ && #Not at char 1
# actual declarations
($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
$prevline =~ /^\+\s+$Ident(?:\s+|\s*\*\s*)$Ident\s*[=,;\[]/ ||
# known declaration macros
@@ -2307,6 +2309,8 @@ sub process {
$prevline =~ /(?:\{\s*|\\)$/) &&
# looks like a declaration
!($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
$sline =~ /^\+\s+$Ident(?:\s+|\s*\*\s*)$Ident\s*[=,;\[]/ ||
# known declaration macros
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2014-06-06 18:33 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20140604225241.16944.94025.stgit@gitlad.jf.intel.com>
[not found] ` <20140604225343.16944.46261.stgit@gitlad.jf.intel.com>
[not found] ` <804857E1F29AAC47BF68C404FC60A18465623125@ORSMSX105.amr.corp.intel.com>
[not found] ` <1402071084.13264.0.camel@joe-AO725>
[not found] ` <804857E1F29AAC47BF68C404FC60A184656232C2@ORSMSX105.amr.corp.intel.com>
[not found] ` <1402072268.13264.4.camel@joe-AO725>
[not found] ` <804857E1F29AAC47BF68C404FC60A184656254DF@ORSMSX105.amr.corp.intel.com>
2014-06-06 18:33 ` [PATCH] checkpatch: Fix function pointers in blank line needed after declarations test Joe Perches
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®