From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: Akira Yokosawa <akiyks@gmail.com>
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>,
Yury Norov <yury.norov@gmail.com>,
Vincent Guittot <vincent.guittot@linaro.org>,
linux-doc@vger.kernel.org, Jonathan Corbet <corbet@lwn.net>,
linux-kernel@vger.kernel.org,
Viresh Kumar <viresh.kumar@linaro.org>
Subject: Re: [PATCH V2 1/2] cpumask: Fix kernel-doc formatting errors in cpumask.h
Date: Mon, 10 Mar 2025 16:56:38 +0100 [thread overview]
Message-ID: <20250310165638.7b001393@sal.lan> (raw)
In-Reply-To: <bcce7d39-f142-4838-ba23-4fa2dda69fd0@gmail.com>
Em Tue, 11 Mar 2025 00:27:47 +0900
Akira Yokosawa <akiyks@gmail.com> escreveu:
> Hi,
>
> Mauro Carvalho Chehab wrote:
> > Em Fri, 7 Mar 2025 13:04:51 +0530
> [...]
> >> /**
> >> - * cpumask_first_and - return the first cpu from *srcp1 & *srcp2
> >> + * cpumask_first_and - return the first cpu from *@srcp1 & *@srcp2
> >
> > I don't think this would produce the right output. See my other comment.
> >
> > See, if I add this there:
> >
> > * cpumask_first_and - return the first cpu from ``*srcp1`` & @srcp2 & *@srp3
> >
> > The kernel-doc output is:
> >
> > .. c:function:: unsigned int cpumask_first_and (const struct cpumask *srcp1, const struct cpumask *srcp2)
> >
> > return the first cpu from ``*srcp1`` & **srcp2** & ***srp3**
> >
> > e.g.:
> >
> > - srcp1: will not be bold, but it will use a monospaced font and will have
> > an asterisk;
> >
> > - srcp2: will be bold, without asterisk;
> >
> > - srcp3: violates ReST spec: different versions may show it different
> > and warnings may be issued.
>
> This third pattern is available since commit 69fc23efc7e5 ("kernel-doc:
> Add unary operator * to $type_param_ref") and I haven't heard of any
> regression report.
>
> Sphinx parses ***srp3** in the following way:
>
> - It sees the first ** and start strong emphasis.
> - It continues that mode until it sees next **.
>
> In the end, Sphinx will produce strongly emphasized "*srp3".
Yes, I got it. But, as "*" is a reserved symbol, used already as
*italic* and **bold**, nothing prevents some day to have a ***something***.
Also, other ReST tools may misinterpret that,as, IMO, this has
undefined behavior. So, better avoid that.
> It would be much better to convert *@srp3 into "\*\ **srp3", which will
> result in normal "*" followed by emphasized "srp3", but I didn't go that
> far at that time.
Yeah, either that or **\*srp3** to keep the asterisk bold
(assuming it works properly) [1].
[1] I remember I had some troubles with escape codes on
bold before, but can't rename exactly on what version.
> This looked sufficient to me as a band-aid workaround.
>
> Or you are aware of any Sphinx version who doesn't work in this way?
Didn't check this specific issue.
>
> Thanks, Akira
>
next prev parent reply other threads:[~2025-03-10 15:56 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-07 7:34 [PATCH V2 0/2] docs: core-api: Update kernel-api.rst to include cpumask.h Viresh Kumar
2025-03-07 7:34 ` [PATCH V2 1/2] cpumask: Fix kernel-doc formatting errors in cpumask.h Viresh Kumar
2025-03-07 9:02 ` Akira Yokosawa
2025-03-07 10:57 ` Akira Yokosawa
2025-03-07 11:28 ` Viresh Kumar
2025-03-07 11:20 ` Akira Yokosawa
2025-03-07 17:05 ` Yury Norov
2025-03-10 6:15 ` Viresh Kumar
2025-03-10 9:03 ` Viresh Kumar
2025-03-10 9:29 ` Akira Yokosawa
2025-03-10 9:11 ` Akira Yokosawa
2025-03-10 14:07 ` Jonathan Corbet
2025-03-10 14:43 ` Mauro Carvalho Chehab
2025-03-17 9:24 ` Viresh Kumar
2025-03-10 14:53 ` Mauro Carvalho Chehab
2025-03-10 15:27 ` Akira Yokosawa
2025-03-10 15:56 ` Mauro Carvalho Chehab [this message]
2025-03-17 8:53 ` Viresh Kumar
2025-03-07 7:34 ` [PATCH V2 2/2] docs: core-api: Update kernel-api.rst to include cpumask.h Viresh Kumar
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=20250310165638.7b001393@sal.lan \
--to=mchehab+huawei@kernel.org \
--cc=akiyks@gmail.com \
--cc=corbet@lwn.net \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
--cc=vincent.guittot@linaro.org \
--cc=viresh.kumar@linaro.org \
--cc=yury.norov@gmail.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