mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jonathan Corbet <corbet@lwn.net>
To: Sean Anderson <sean.anderson@linux.dev>, linux-doc@vger.kernel.org
Cc: linux-kernel@vger.kernel.org,
	Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
	Sean Anderson <sean.anderson@linux.dev>
Subject: Re: [PATCH] scripts: kernel-doc: fix parsing function-like typedefs (again)
Date: Mon, 07 Apr 2025 16:34:24 -0600	[thread overview]
Message-ID: <87h62z8utr.fsf@trenco.lwn.net> (raw)
In-Reply-To: <20250407222134.2280553-1-sean.anderson@linux.dev>

Sean Anderson <sean.anderson@linux.dev> writes:

> Typedefs like
>
>     typedef struct phylink_pcs *(*pcs_xlate_t)(const u64 *args);
>
> have a typedef_type that ends with a * and therefore has no word
> boundary. Add an extra clause for the final group of the typedef_type so
> we only require a word boundary if we match a word.
>
> Fixes: 7d2c6b1edf79 ("scripts: kernel-doc: fix parsing function-like typedefs")
> Signed-off-by: Sean Anderson <sean.anderson@linux.dev>
> ---
>
>  scripts/kernel-doc | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/kernel-doc b/scripts/kernel-doc
> index af6cf408b96d..5db23cbf4eb2 100755
> --- a/scripts/kernel-doc
> +++ b/scripts/kernel-doc
> @@ -1325,7 +1325,7 @@ sub dump_enum($$) {
>      }
>  }
>  
> -my $typedef_type = qr { ((?:\s+[\w\*]+\b){1,8})\s* }x;
> +my $typedef_type = qr { ((?:\s+[\w\*]+\b){0,7}\s+(?:\w+\b|\*+))\s* }x;
>  my $typedef_ident = qr { \*?\s*(\w\S+)\s* }x;
>  my $typedef_args = qr { \s*\((.*)\); }x;

This seems like a worth fix but ... we're kind of hoping to replace that
script entirely in 6.16.

Mauro, do you have a series for me along those lines?  It seems like
time to put that in if we're going to do it.  Then maybe this fix could
be adapted on top?

Thanks,

jon

  reply	other threads:[~2025-04-07 22:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-07 22:21 Sean Anderson
2025-04-07 22:34 ` Jonathan Corbet [this message]
2025-04-08  6:22   ` Mauro Carvalho Chehab

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=87h62z8utr.fsf@trenco.lwn.net \
    --to=corbet@lwn.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab+huawei@kernel.org \
    --cc=sean.anderson@linux.dev \
    /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®