From: Joe Perches <joe@perches.com>
To: Miles Chen <miles.chen@mediatek.com>,
Andy Whitcroft <apw@canonical.com>,
Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, wsd_upstream@mediatek.com,
linux-mediatek@lists.infradead.org
Subject: Re: [PATCH v2] checkpatch: support function pointers for unnamed function definition arguments
Date: Thu, 14 Sep 2017 23:01:08 -0700 [thread overview]
Message-ID: <1505455268.27581.3.camel@perches.com> (raw)
In-Reply-To: <1505389925-31087-1-git-send-email-miles.chen@mediatek.com>
On Thu, 2017-09-14 at 19:52 +0800, Miles Chen wrote:
> Current unnamed function definition argument does not include function
> pointer cases and it reports something like:
>
> WARNING: function definition argument 'void' should also have an identifier name
> +unsigned int (*dummy)(void);
>
> Support function pointers for unnamed function arguments
>
> Signed-off-by: Miles Chen <miles.chen@mediatek.com>
Acked-by: Joe Perches <joe@perches.com>
> ---
> scripts/checkpatch.pl | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index dd2c262..03eb255 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -5957,7 +5957,7 @@ sub process {
>
> # check for function declarations that have arguments without identifier names
> if (defined $stat &&
> - $stat =~ /^.\s*(?:extern\s+)?$Type\s*$Ident\s*\(\s*([^{]+)\s*\)\s*;/s &&
> + $stat =~ /^.\s*(?:extern\s+)?$Type\s*(?:$Ident|\(\s*\*\s*$Ident\s*\))\s*\(\s*([^{]+)\s*\)\s*;/s &&
> $1 ne "void") {
> my $args = trim($1);
> while ($args =~ m/\s*($Type\s*(?:$Ident|\(\s*\*\s*$Ident?\s*\)\s*$balanced_parens)?)/g) {
prev parent reply other threads:[~2017-09-15 6:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-14 11:52 Miles Chen
2017-09-15 6:01 ` Joe Perches [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1505455268.27581.3.camel@perches.com \
--to=joe@perches.com \
--cc=akpm@linux-foundation.org \
--cc=apw@canonical.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=miles.chen@mediatek.com \
--cc=wsd_upstream@mediatek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®