All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jonathan Neuschäfer" <j.neuschaefer@gmx.net>
To: "Paul E. McKenney" <paulmck@kernel.org>
Cc: "Jonathan Neuschäfer" <j.neuschaefer@gmx.net>,
	rcu@vger.kernel.org, "Josh Triplett" <josh@joshtriplett.org>,
	"Steven Rostedt" <rostedt@goodmis.org>,
	"Mathieu Desnoyers" <mathieu.desnoyers@efficios.com>,
	"Lai Jiangshan" <jiangshanlai@gmail.com>,
	"Joel Fernandes" <joel@joelfernandes.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rculist: Describe variadic macro argument in a Sphinx-compatible way
Date: Sat, 5 Oct 2019 21:31:23 +0200	[thread overview]
Message-ID: <20191005193123.GD19803@latitude> (raw)
In-Reply-To: <20191005133330.GX2689@paulmck-ThinkPad-P72>

[-- Attachment #1: Type: text/plain, Size: 2064 bytes --]

On Sat, Oct 05, 2019 at 06:33:30AM -0700, Paul E. McKenney wrote:
> On Sat, Oct 05, 2019 at 01:23:28AM +0200, Jonathan Neuschäfer wrote:
> > On Fri, Oct 04, 2019 at 03:24:39PM -0700, Paul E. McKenney wrote:
> > > On Fri, Oct 04, 2019 at 11:54:02PM +0200, Jonathan Neuschäfer wrote:
> > > > Without this patch, Sphinx shows "variable arguments" as the description
> > > > of the cond argument, rather than the intended description, and prints
> > > > the following warnings:
> > > > 
> > > > ./include/linux/rculist.h:374: warning: Excess function parameter 'cond' description in 'list_for_each_entry_rcu'
> > > > ./include/linux/rculist.h:651: warning: Excess function parameter 'cond' description in 'hlist_for_each_entry_rcu'
> > 
> > Hmm, small detail that I didn't realize before: It's actually the
> > kernel-doc script, not Sphinx, that can't deal with variadic macro
> > arguments and thus requires this patch.
> > 
> > So it may also be possible to fix the script instead. (I have not
> > looked into how much work that would be.)
> 
> OK, thank you for letting me know.  I will keep your patch for the
> moment, but please let me know if the fix can be elsewhere.
> 
> 							Thanx, Paul

Turns out the actual fix in scripts/kernel-doc is easy enough:

--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -1449,6 +1449,10 @@ sub push_parameter($$$$) {
 	      # handles unnamed variable parameters
 	      $param = "...";
 	    }
+	    elsif ($param =~ /\w\.\.\.$/) {
+	      # for named variable parameters of the form `x...`, remove the dots
+	      $param =~ s/\.\.\.$//;
+	    }
 	    if (!defined $parameterdescs{$param} || $parameterdescs{$param} eq "") {
 		$parameterdescs{$param} = "variable arguments";
 	    }

... but there are other macros in the code base that are documented
using the 'x...' syntax, so I guess it's best to take my initial patch
(or something similar) now, and I'll fix kernel-doc later, in a longer
patchset that also cleans up the fallout.


Thanks,
Jonathan Neuschäfer

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2019-10-05 19:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-04 21:54 [PATCH] rculist: Describe variadic macro argument in a Sphinx-compatible way Jonathan Neuschäfer
2019-10-04 22:24 ` Paul E. McKenney
2019-10-04 23:23   ` Jonathan Neuschäfer
2019-10-05 13:33     ` Paul E. McKenney
2019-10-05 19:31       ` Jonathan Neuschäfer [this message]
2019-10-05 19:35         ` Paul E. McKenney
2019-10-06 23:44   ` Joel Fernandes

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=20191005193123.GD19803@latitude \
    --to=j.neuschaefer@gmx.net \
    --cc=jiangshanlai@gmail.com \
    --cc=joel@joelfernandes.org \
    --cc=josh@joshtriplett.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=paulmck@kernel.org \
    --cc=rcu@vger.kernel.org \
    --cc=rostedt@goodmis.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.