From: Jonathan Corbet <corbet@lwn.net>
To: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] docs: kernel-doc: fix parsing of function pointers
Date: Mon, 3 Sep 2018 13:00:43 -0600 [thread overview]
Message-ID: <20180903130043.059b2e82@lwn.net> (raw)
In-Reply-To: <20180903184153.9368-1-xypron.glpk@gmx.de>
On Mon, 3 Sep 2018 20:41:53 +0200
Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
> The same script kernel-doc is used by the U-Boot project.
Interesting, I didn't know that. Please pass on my condolences :)
>
> kernel-doc fails to parse function definitions like the one below
>
> efi_status_t efi_create_event(uint32_t type, efi_uintn_t notify_tpl,
> void (EFIAPI *notify_function) (
> struct efi_event *event,
> void *context),
> void *notify_context, efi_guid_t *group,
> struct efi_event **event)
> {
>
> due to the "EFIAPI" attribute preceding the function name.
This is a good description of the problem; a proper changelog should
really say what the patch *does* about the problem too. Especially
since...
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
> scripts/kernel-doc | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/kernel-doc b/scripts/kernel-doc
> index 31a34ced55a3..597e3223b791 100755
> --- a/scripts/kernel-doc
> +++ b/scripts/kernel-doc
> @@ -1381,7 +1381,7 @@ sub create_parameterlist($$$$) {
> } elsif ($arg =~ m/\(.+\)\s*\(/) {
> # pointer-to-function
> $arg =~ tr/#/,/;
> - $arg =~ m/[^\(]+\(\*?\s*([\w\.]*)\s*\)/;
> + $arg =~ m/[^\(]+\([\w\s]*\*?\s*([\w\.]*)\s*\)/;
The meaning of this change doesn't just jump off the screen, even for
folks who are accustomed to reading regexes. It would be nice to explain
what is actually being changed and what the expected new behavior is. It
appears to be consuming any normal text/white space prior to the optional
"*". Are you sure it doesn't overshoot and consume too much if the *
isn't there?
Thanks,
jon
next prev parent reply other threads:[~2018-09-03 19:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-03 18:41 [PATCH 1/1] docs: kernel-doc: fix parsing of function pointers Heinrich Schuchardt
2018-09-03 19:00 ` Jonathan Corbet [this message]
2018-09-03 20:29 ` Heinrich Schuchardt
2018-09-03 21:38 ` Jonathan Corbet
2018-09-03 22:28 ` Joe Perches
2018-09-03 22:54 ` Bernd Petrovitsch
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=20180903130043.059b2e82@lwn.net \
--to=corbet@lwn.net \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=xypron.glpk@gmx.de \
/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