qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: "Peter Xu" <peterx@redhat.com>, "Alex Bennée" <alex.bennee@linaro.org>
Cc: qemu-devel@nongnu.org,
	"Elena Ufimtseva" <elena.ufimtseva@oracle.com>,
	"John G Johnson" <john.g.johnson@oracle.com>,
	"Jagannathan Raman" <jag.raman@oracle.com>,
	"Mahmoud Mandour" <ma.mandourr@gmail.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Alexandre Iooss" <erdnaxe@crans.org>,
	"Manos Pitsidianakis" <manos.pitsidianakis@linaro.org>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Eduardo Habkost" <eduardo@habkost.net>,
	"Juan Quintela" <quintela@redhat.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	peter.maydell@linaro.org, "David Hildenbrand" <david@redhat.com>
Subject: Re: [PATCH 1/5] scripts/kernel-doc: teach kdoc about QLIST_ macros
Date: Fri, 8 Mar 2024 09:49:35 +0100	[thread overview]
Message-ID: <9b70c85e-0c4f-47f6-ade2-a227c5b70401@redhat.com> (raw)
In-Reply-To: <ZerK2iI7FAGuQH1O@x1n>

On 08/03/2024 09.22, Peter Xu wrote:
> On Fri, Mar 08, 2024 at 08:09:15AM +0000, Alex Bennée wrote:
>> Peter Xu <peterx@redhat.com> writes:
>>
>>> On Thu, Mar 07, 2024 at 06:11:01PM +0000, Alex Bennée wrote:
>>>> The kernel-doc script does some pre-processing on structure
>>>> definitions before parsing for names. Teach it about QLIST and replace
>>>> with simplified structures representing the base type.
>>>>
>>>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
>>>> ---
>>>>   scripts/kernel-doc | 9 ++++++++-
>>>>   1 file changed, 8 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/scripts/kernel-doc b/scripts/kernel-doc
>>>> index 240923d509a..26c47562e79 100755
>>>> --- a/scripts/kernel-doc
>>>> +++ b/scripts/kernel-doc
>>>> @@ -1226,7 +1226,14 @@ sub dump_struct($$) {
>>>>   	# replace DECLARE_KFIFO_PTR
>>>>   	$members =~ s/DECLARE_KFIFO_PTR\s*\(([^,)]+),\s*([^,)]+)\)/$2 \*$1/gos;
>>>>   
>>>> -	my $declaration = $members;
>>>> +        # QEMU Specific Macros
>>>> +
>>>> +        # replace QLIST_ENTRY with base type and variable name
>>>> +        $members =~ s/QLIST_ENTRY\(([^)]+)\)\s+([^;]+)/$1 \*$2/gos;
>>>> +        # replace QLIST_HEAD, optionally capturing an anonymous struct marker, and capture type and variable name
>>>> +        $members =~ s/QLIST_HEAD\(\s*,\s*([^)]+)\)\s+([^;]+)/struct { $1 *lh_first; } $2/gos;
>>>> +
>>>> +        my $declaration = $members;
>>>
>>> May need a "tabify" here..
>>
>> Ugg that file is a mess. Any idea what we should use for perl, tabs or
>> spaces? I can update editorconfig.
> 
> Indeed.. not perl expert here.
> 
> For this one it might be still good to keep the same with the code around
> before an attempt to clean it up.

I think this file originate from the Linux kernel repo, so it might be a 
good idea to keep it in sync with the version from there?

  Thomas




  reply	other threads:[~2024-03-08  8:50 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-07 18:11 [PATCH 0/5] docs: improve the memory API documentation Alex Bennée
2024-03-07 18:11 ` [PATCH 1/5] scripts/kernel-doc: teach kdoc about QLIST_ macros Alex Bennée
2024-03-08  7:40   ` Peter Xu
2024-03-08  8:09     ` Alex Bennée
2024-03-08  8:22       ` Peter Xu
2024-03-08  8:49         ` Thomas Huth [this message]
2024-03-08 14:13           ` Peter Maydell
2024-03-07 18:11 ` [PATCH 2/5] docs: include ramblock.h in the memory API docs Alex Bennée
2024-03-08  8:03   ` Peter Xu
2024-03-07 18:11 ` [PATCH 3/5] include/exec: remove warning_printed from MemoryRegion Alex Bennée
2024-03-07 20:40   ` Richard Henderson
2024-03-07 20:40   ` Philippe Mathieu-Daudé
2024-03-08  8:03   ` Peter Xu
2024-03-07 18:11 ` [PATCH 4/5] include/exec: annotate all the MemoryRegion fields Alex Bennée
2024-03-07 20:41   ` Richard Henderson
2024-03-07 22:38     ` Alex Bennée
2024-03-08 14:34   ` Peter Maydell
2024-03-07 18:11 ` [PATCH 5/5] docs/devel: mark out defined functions and structures Alex Bennée
2024-03-08 14:35   ` Peter Maydell

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=9b70c85e-0c4f-47f6-ade2-a227c5b70401@redhat.com \
    --to=thuth@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=david@redhat.com \
    --cc=eduardo@habkost.net \
    --cc=elena.ufimtseva@oracle.com \
    --cc=erdnaxe@crans.org \
    --cc=jag.raman@oracle.com \
    --cc=john.g.johnson@oracle.com \
    --cc=ma.mandourr@gmail.com \
    --cc=manos.pitsidianakis@linaro.org \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=peterx@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=richard.henderson@linaro.org \
    /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).