[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <bb0be69b3d4483a9e8a29bedca9e1117a42e40f9.camel@perches.com>
Date: Tue, 31 Oct 2023 10:37:55 -0700
From: Joe Perches <joe@...ches.com>
To: Dan Carpenter <dan.carpenter@...aro.org>,
Rohit Chavan <roheetchavan@...il.com>
Cc: Martyn Welch <martyn@...chs.me.uk>,
Manohar Vanga <manohar.vanga@...il.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-kernel@...r.kernel.org, linux-staging@...ts.linux.dev
Subject: Re: [PATCH] staging: vme_user: Added blank line after declarations
On Tue, 2023-10-31 at 13:27 +0300, Dan Carpenter wrote:
> On Tue, Oct 31, 2023 at 10:06:10AM +0000, Rohit Chavan wrote:
> > Fixes below warning reported by checkpatch.
> > WARNING: Missing a blank line after declarations
> >
> > Signed-off-by: Rohit Chavan <roheetchavan@...il.com>
>
> This is a checkpatch false positive. (It's not "after declarations").
> Just ignore it.
>
checkpatch could accept function pointer and function pointer arrays
---
scripts/checkpatch.pl | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 25fdb7fda1128..de1f4962f55d6 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1073,6 +1073,7 @@ our $Typecast = qr{\s*(\(\s*$NonptrType\s*\)){0,1}\s*};
# Any use must be runtime checked with $^V
our $balanced_parens = qr/(\((?:[^\(\)]++|(?-1))*\))/;
+our $balanced_brackets = qr/(\[(?:[^\[\]]++|(?-1))*\])/;
our $LvalOrFunc = qr{((?:[\&\*]\s*)?$Lval)\s*($balanced_parens{0,1})\s*};
our $FuncArg = qr{$Typecast{0,1}($LvalOrFunc|$Constant|$String)};
@@ -4107,7 +4108,7 @@ sub process {
# looks like a declaration
!($sl =~ /^\+\s+$Declare\s*$Ident\s*[=,;:\[]/ ||
# function pointer declarations
- $sl =~ /^\+\s+$Declare\s*\(\s*\*\s*$Ident\s*\)\s*[=,;:\[\(]/ ||
+ $sl =~ /^\+\s+$Declare\s*\(\s*\*\s*$Ident(?:\s*$balanced_brackets)*\s*\)\s*[=,;:\[\(]/ ||
# foo bar; where foo is some local typedef or #define
$sl =~ /^\+\s+$Ident(?:\s+|\s*\*\s*)$Ident\s*[=,;\[]/ ||
# known declaration macros
Powered by blists - more mailing lists