From: Randy Dunlap <rdunlap@infradead.org>
To: Jonathan Corbet <corbet@lwn.net>,
Vlastimil Babka <vbabka@suse.cz>,
David Rientjes <rientjes@google.com>,
Christoph Lameter <cl@linux.com>,
Horia Geanta <horia.geanta@freescale.com>
Cc: Hyeonggon Yoo <42.hyeyoo@gmail.com>,
Roman Gushchin <roman.gushchin@linux.dev>,
Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org, linux-doc@vger.kernel.org
Subject: Re: [partial fix] Re: [PATCH] mm, slab: add kerneldocs for common SLAB_ flags
Date: Thu, 10 Oct 2024 16:54:46 -0700 [thread overview]
Message-ID: <5b16b00f-749c-431b-baeb-7accb76b492b@infradead.org> (raw)
In-Reply-To: <46c52676-c402-4b39-b634-a401f7a7a571@infradead.org>
On 10/10/24 4:43 PM, Randy Dunlap wrote:
>
>
> On 10/9/24 10:06 PM, Randy Dunlap wrote:
>>
>>
>> On 10/9/24 3:02 PM, Randy Dunlap wrote:
>>>
>>>
>>> On 10/9/24 9:49 AM, Jonathan Corbet wrote:
>>>> Vlastimil Babka <vbabka@suse.cz> writes:
>>>>
>>>>> Thanks for the hints. I hope if we can agree that documenting the macros was
>>>>> intended to be supported, doesn't break the build (there are users already)
>>>>> and has only those minor rendering issues, it can be used?
>>>>
>>>> I'd totally forgotten that this was supposed to work.
>>>>
>>>> Yes it can be used... $WE just need to find a way to make it work
>>>> properly.
>>>
>>> The code probably isn't expecting a macro on the right side. I'll take a look,
>>> but no promises.
>>>
>> That would have been too simple.
>> I haven't found the problem yet. Ran out of time. Will continue on it tommorrow/Thursday.
>
> The main problem is that output_function_rst() does not support object-like macros while
> output_function_man() does. There is still a bunch of sphinx_version handling that I know
> nothing about, so the present output (after my trivial patch) leaves more to be done.
>
> Well, the *main* problem is that the output is not consistent. Sometimes my tests don't fail
> as they did at first.
>
>
> This patch drops the trailing "()" for object-like macros in output_function_rst()
> but there is still more to be done.
>
> ---------------------
> From: Randy Dunlap <rdunlap@infradead.org>
> Subject: [PATCH] kernel-doc: allow object-like macros in ReST output
>
> output_function_rst() does not handle object-like macros. It presents
> a trailing "()" while output_function_man() handles these macros
> correctly.
>
> Fixes: cbb4d3e6510b ("scripts/kernel-doc: handle object-like macros")
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: Horia Geanta <horia.geanta@freescale.com>
> Cc: Jonathan Corbet <corbet@lwn.net>
> Cc: linux-doc@vger.kernel.org
> Cc: Vlastimil Babka <vbabka@suse.cz>
> ---
> scripts/kernel-doc | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> --- linux-next-20241009.orig/scripts/kernel-doc
> +++ linux-next-20241009/scripts/kernel-doc
> @@ -822,10 +822,12 @@ sub output_function_rst(%) {
> my $oldprefix = $lineprefix;
>
> my $signature = "";
> + my $noret = $signature eq "";
^^^ That line is in the wrong location. Still working on it....
> +
> if ($args{'functiontype'} ne "") {
> $signature = $args{'functiontype'} . " " . $args{'function'} . " (";
> } else {
> - $signature = $args{'function'} . " (";
> + $signature = $args{'function'} . " ";
> }
>
> my $count = 0;
> @@ -844,7 +846,9 @@ sub output_function_rst(%) {
> }
> }
>
> - $signature .= ")";
> + if (!$noret) {
> + $signature .= ")";
> + }
>
> if ($sphinx_major < 3) {
> if ($args{'typedef'}) {
>
>
--
~Randy
next prev parent reply other threads:[~2024-10-10 23:55 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-09 14:29 Vlastimil Babka
2024-10-09 15:08 ` Jonathan Corbet
2024-10-09 16:11 ` Vlastimil Babka
2024-10-09 16:49 ` Jonathan Corbet
2024-10-09 22:02 ` Randy Dunlap
2024-10-10 5:06 ` Randy Dunlap
2024-10-10 23:43 ` [partial fix] " Randy Dunlap
2024-10-10 23:54 ` Randy Dunlap [this message]
2024-10-11 3:07 ` Randy Dunlap
2024-10-11 22:16 ` Randy Dunlap
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=5b16b00f-749c-431b-baeb-7accb76b492b@infradead.org \
--to=rdunlap@infradead.org \
--cc=42.hyeyoo@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=cl@linux.com \
--cc=corbet@lwn.net \
--cc=horia.geanta@freescale.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=rientjes@google.com \
--cc=roman.gushchin@linux.dev \
--cc=vbabka@suse.cz \
/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