From: Akira Yokosawa <akiyks@gmail.com>
To: Viresh Kumar <viresh.kumar@linaro.org>,
Jonathan Corbet <corbet@lwn.net>,
Yury Norov <yury.norov@gmail.com>
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>,
Vincent Guittot <vincent.guittot@linaro.org>,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
Akira Yokosawa <akiyks@gmail.com>
Subject: Re: [PATCH V2 1/2] cpumask: Fix kernel-doc formatting errors in cpumask.h
Date: Mon, 10 Mar 2025 18:11:41 +0900 [thread overview]
Message-ID: <662656aa-c25b-4f83-8131-eb39a6a42917@gmail.com> (raw)
In-Reply-To: <20250310061540.zpfyisvchyua2cuv@vireshk-i7>
Hi,
Viresh Kumar wrote:
> On 07-03-25, 12:05, Yury Norov wrote:
>> On Fri, Mar 07, 2025 at 01:04:51PM +0530, Viresh Kumar wrote:
>>> /**
>>> - * cpumask_next_and - get the next cpu in *src1p & *src2p
>>> + * cpumask_next_and - get the next cpu in *@src1p & *@src2p
>>> * @n: the cpu prior to the place to search (i.e. return will be > @n)
>>> * @src1p: the first cpumask pointer
>>> * @src2p: the second cpumask pointer
>>
>> So the question: if some word in this particular comment block is
>> prefixed with @ symbol, can we teach kernel-doc to consider every
>> occurrence of this word as a variable?
That is not impossible, I would say.
>>
>> Why I'm asking: before the "*src1p & *src2p" was a line of C code.
>> And because we are all C programmers here, it's really simple to ident
>> it and decode. After it looks like something weird, and I think many
>> of us will just mentally skip it.
>>
>> I like kernel-docs and everything, but again, kernel sources should
>> stay readable, and particularly comments should stay human-readable.
>
> Jonathan / Akira, can you please answer this one ?
I was not around when transition to Sphinx was made in 2016, and I don't
know much of kernel-doc (or its predecessor doc-book) comment format.
So below is my wild guesses.
Current Documentation/doc-guide/kernel-doc.rst has no mention of "*" WRT
where it is allowed or disallowed, which results in occasional complaints
from Sphinx on unmatched start/end of emphasis.
However, the use of "*" is indicated for itemized list, which directly
employs reST format.
It doesn't say anything about literal/code blocks, either.
So I have to say that current kernel-doc has quite a few of undefined
things on reST output.
kernel-doc in python3 might help untangle the mess.
This all need some consensus on kenrel-doc behavior to be reached, and
update/enhance of kernel-doc (script).
So my suggestion would be to hold these changes for the time being.
>
>>> @@ -334,7 +334,8 @@ unsigned int __pure cpumask_next_wrap(int n, const struct cpumask *mask, int sta
>>> * @mask1: the first cpumask pointer
>>> * @mask2: the second cpumask pointer
>>> *
>>> - * This saves a temporary CPU mask in many places. It is equivalent to:
>>> + * This saves a temporary CPU mask in many places. It is equivalent to::
>>> + *
>>
>> I'm OK with extra line, but this double-colon. What for and what does
>> it mean?
>
> Without this we get: "ERROR: Unexpected indentation", for the last
> line of the code block that contains: " ...".
>
> The double-colon creates a code-block for the below code and gets rid
> of the warning.
>>
>>> /**
>>> - * cpumask_weight - Count of bits in *srcp
>>> + * cpumask_weight - Count of bits in *@srcp
>>> * @srcp: the cpumask to count bits (< nr_cpu_ids) in.
>>
>> Here nr_cpu_ids is also a variable. Why you don't prefix it with @?
>
> I was only looking to fix the build warnings / errors for now, and did
> not look into detail for such issues. Yes, it should be marked with @.
> I will try to go through all the comments now and fix such issues.
>
Provided the brokenness of kernel-doc spec & script, I think you can
wait until it is properly fixed/enhanced.
The problem is: Is there somebody who would be interested enough to do
such an improvement?
Thanks, Akira
next prev parent reply other threads:[~2025-03-10 9:11 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 [this message]
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
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=662656aa-c25b-4f83-8131-eb39a6a42917@gmail.com \
--to=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
all inboxes | Powered by JetHome®