linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Corbet <corbet@lwn.net>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org,
	Eduardo Habkost <ehabkost@redhat.com>
Subject: Re: [PATCH 2/2] kernel-doc: Handle function typedefs without asterisks
Date: Fri, 13 Nov 2020 15:21:06 -0700	[thread overview]
Message-ID: <20201113152106.7b4a07ee@lwn.net> (raw)
In-Reply-To: <20201030144713.201372-3-pbonzini@redhat.com>

On Fri, 30 Oct 2020 15:47:13 +0100
Paolo Bonzini <pbonzini@redhat.com> wrote:

> From: Eduardo Habkost <ehabkost@redhat.com>
> 
> Example of typedef that was not parsed by kernel-doc:
> 
>   typedef void (ObjectUnparent)(Object *obj);
> 
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

So as you've undoubtedly noticed, reading those kernel-doc regexes is ... a
wee bit on the painful side.  Trying to compare two of them in a patch to
figure out what you have done is even worse.  I suspect we want these
patches, but can you please supply a changelog that describes the change? 

> ---
>  scripts/kernel-doc | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/kernel-doc b/scripts/kernel-doc
> index 5b5caa7642f7..1a9c918aa653 100755
> --- a/scripts/kernel-doc
> +++ b/scripts/kernel-doc
> @@ -1302,7 +1302,7 @@ sub dump_typedef($$) {
>      $x =~ s@/\*.*?\*/@@gos;	# strip comments.
>  
>      # Parse function prototypes
> -    if ($x =~ /typedef\s+(\w+\s*\**)\s*\(\*\s*(\w\S+)\s*\)\s*\((.*)\);/ ||
> +    if ($x =~ /typedef\s+(\w+\s*\**)\s*\(\*?\s*(\w\S+)\s*\)\s*\((.*)\);/ ||

Here it appears that you are making the "*" before the function-pointer
name optional, right?  It really would help to say so in the changelog.

This is true for the other patch as well.

>  	$x =~ /typedef\s+(\w+\s*\**)\s*(\w\S+)\s*\s*\((.*)\);/) {
>  
>  	# Function typedefs

Thanks,

jon

  reply	other threads:[~2020-11-13 22:21 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-30 14:47 [PATCH 0/2] kernel-doc: Handle function typedefs Paolo Bonzini
2020-10-30 14:47 ` [PATCH 1/2] kernel-doc: Handle function typedefs that return pointers Paolo Bonzini
2020-10-30 14:47 ` [PATCH 2/2] kernel-doc: Handle function typedefs without asterisks Paolo Bonzini
2020-11-13 22:21   ` Jonathan Corbet [this message]
2020-11-13 22:35     ` Paolo Bonzini
2020-11-13 22:39     ` Matthew Wilcox
2020-11-17 21:24       ` Eduardo Habkost
2020-11-17 21:30         ` Matthew Wilcox
2020-11-17 22:36           ` [RFC] Add kernel-doc test script Eduardo Habkost
2020-11-18  0:23             ` Randy Dunlap
2020-11-18 13:03               ` Eduardo Habkost
2020-11-18 16:32                 ` Randy Dunlap
2020-11-18 16:57                   ` Eduardo Habkost
2020-11-18 16:58                     ` Randy Dunlap
2020-11-18  8:21             ` Paolo Bonzini
2020-11-18 12:05               ` Eduardo Habkost
2020-11-18 16:27             ` Jonathan Corbet

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=20201113152106.7b4a07ee@lwn.net \
    --to=corbet@lwn.net \
    --cc=ehabkost@redhat.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.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;
as well as URLs for NNTP newsgroup(s).