linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
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: Fri, 11 Oct 2024 15:16:47 -0700	[thread overview]
Message-ID: <9e09f97e-90ca-4a36-a6cc-0234d683c9fa@infradead.org> (raw)
In-Reply-To: <eef0d9af-4d04-46b1-b132-1213fa97b97b@infradead.org>



On 10/10/24 8:07 PM, Randy Dunlap wrote:
> 
> 
> On 10/10/24 4:54 PM, Randy Dunlap wrote:
>>
>>
>> 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:
>>>>>>
>>>
>>> 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.
>>>
>>> ---------------------
> 
> This one mostly works for me although I don't care for the second line
> here. I guess it has something to do with cross-referencing(?), but IDK.
> 

That seems to be normal but this patch now causes regressions for macros that
do have parameters. Back to searching...

> 
> """
> SLAB_TYPESAFE_BY_RCU
> ``SLAB_TYPESAFE_BY_RCU ``
> 
> WARNING READ THIS!
> 
> Description
> """
> 
> ---
> 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 |   13 ++++++++++---
>  1 file changed, 10 insertions(+), 3 deletions(-)
> 
> --- linux-next-20241009.orig/scripts/kernel-doc
> +++ linux-next-20241009/scripts/kernel-doc
> @@ -822,10 +822,13 @@ sub output_function_rst(%) {
>      my $oldprefix = $lineprefix;
>  
>      my $signature = "";
> +    my $noret = 0;
> +
>      if ($args{'functiontype'} ne "") {
>          $signature = $args{'functiontype'} . " " . $args{'function'} . " (";
>      } else {
> -        $signature = $args{'function'} . " (";
> +        $signature = $args{'function'} . " ";
> +    	$noret = 1;
>      }
>  
>      my $count = 0;
> @@ -844,7 +847,9 @@ sub output_function_rst(%) {
>          }
>      }
>  
> -    $signature .= ")";
> +    if (!$noret) {
> +    	$signature .= ")";
> +    }
>  
>      if ($sphinx_major < 3) {
>          if ($args{'typedef'}) {
> @@ -890,7 +895,9 @@ sub output_function_rst(%) {
>      #
>      print ".. container:: kernelindent\n\n";
>      $lineprefix = "  ";
> -    print $lineprefix . "**Parameters**\n\n";
> +	if (!$noret) {
> +   		print $lineprefix . "**Parameters**\n\n";
> +    }
>      foreach $parameter (@{$args{'parameterlist'}}) {
>          my $parameter_name = $parameter;
>          $parameter_name =~ s/\[.*//;
> 
> 

-- 
~Randy


      reply	other threads:[~2024-10-11 22:17 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
2024-10-11  3:07               ` Randy Dunlap
2024-10-11 22:16                 ` Randy Dunlap [this message]

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=9e09f97e-90ca-4a36-a6cc-0234d683c9fa@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