From: Akira Yokosawa <akiyks@gmail.com>
To: viresh.kumar@linaro.org
Cc: linux-kernel@vger.kernel.org, linux@rasmusvillemoes.dk,
vincent.guittot@linaro.org, yury.norov@gmail.com,
Akira Yokosawa <akiyks@gmail.com>
Subject: Re: [PATCH 1/2] cpumask: Fix kernel-doc formatting errors in cpumask.h
Date: Fri, 7 Mar 2025 00:38:41 +0900 [thread overview]
Message-ID: <8cacf9df-fb8e-40d5-a716-cc43a266b43b@gmail.com> (raw)
In-Reply-To: <1489a042f329b1c1238756c68fd880e2966f242d.1741257214.git.viresh.kumar@linaro.org>
Hello Viresh,
On Thu, 6 Mar 2025 16:06:50 +0530, Viresh Kumar wrote:
> This fixes various kernel-doc formatting errors in cpumask.h:
>
> - WARNING: Inline literal start-string without end-string.
> - ERROR: Unexpected indentation.
> - ERROR: Unknown target name: "gfp".
>
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> ---
> include/linux/cpumask.h | 65 +++++++++++++++++++++++------------------
> 1 file changed, 37 insertions(+), 28 deletions(-)
>
> diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h
> index 36a890d0dd57..73ba808c559f 100644
> --- a/include/linux/cpumask.h
> +++ b/include/linux/cpumask.h
> @@ -20,7 +20,7 @@
> * cpumask_pr_args - printf args to output a cpumask
> * @maskp: cpumask to be printed
> *
> - * Can be used to provide arguments for '%*pb[l]' when printing a cpumask.
> + * Can be used to provide arguments for '\%*pb[l]' when printing a cpumask.
kernel-doc (script) can recognize the pattern of %*pb but not %*pb[l].
"%*bp [l]" should work here.
(without quotes and a white space in front of "[").
No need to escape "%".
> */
> #define cpumask_pr_args(maskp) nr_cpu_ids, cpumask_bits(maskp)
>
> @@ -166,7 +166,7 @@ static __always_inline unsigned int cpumask_first_zero(const struct cpumask *src
> }
>
> /**
> - * cpumask_first_and - return the first cpu from *srcp1 & *srcp2
> + * cpumask_first_and - return the first cpu from \*srcp1 & \*srcp2
kernel-doc (script) understands the pattern of *@srcp1.
No need to escape "*".
But it does not (yet) parse the pattern of "*@n+1". You need to say
"*@n +1", with a space in front of "+1", for the time being.
[...]
> @@ -335,6 +335,9 @@ unsigned int __pure cpumask_next_wrap(int n, const struct cpumask *mask, int sta
> * @mask2: the second cpumask pointer
> *
> * This saves a temporary CPU mask in many places. It is equivalent to:
> + *
> + * .. code-block:: c
> + *
> * struct cpumask tmp;
> * cpumask_and(&tmp, &mask1, &mask2);
> * for_each_cpu(cpu, &tmp)
Do you really want those code-blocks to look fancy?
In kernel-doc comments, I'd normally use plain literal blocks instead.
Something like:
* This saves a temporary CPU mask in many places. It is equivalent to::
*
* struct cpumask tmp;
* cpumask_and(&tmp, &mask1, &mask2);
* for_each_cpu(cpu, &tmp)
should work. Note the "::" and the empty line below it.
[...]
> @@ -941,7 +950,7 @@ bool zalloc_cpumask_var_node(cpumask_var_t *mask, gfp_t flags, int node)
> /**
> * alloc_cpumask_var - allocate a struct cpumask
> * @mask: pointer to cpumask_var_t where the cpumask is returned
> - * @flags: GFP_ flags
> + * @flags: GFP\_ flags
You can say:
* @flags: %GFP_ flags
instead.
> *
> * Only defined when CONFIG_CPUMASK_OFFSTACK=y, otherwise is
> * a nop returning a constant 1 (in <linux/cpumask.h>).
[...]
Side note:
I think 1/2 would be better to be CC'ed linux-doc as well.
Please do so in respin.
Thanks, Akira
next prev parent reply other threads:[~2025-03-06 15:39 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-06 10:36 [PATCH 0/2] docs: core-api: Update kernel-api.rst to include cpumask.h Viresh Kumar
2025-03-06 10:36 ` [PATCH 1/2] cpumask: Fix kernel-doc formatting errors in cpumask.h Viresh Kumar
2025-03-06 15:38 ` Akira Yokosawa [this message]
2025-03-06 18:02 ` Yury Norov
2025-03-07 1:06 ` Akira Yokosawa
2025-03-07 7:35 ` Viresh Kumar
2025-03-06 10:36 ` [PATCH 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=8cacf9df-fb8e-40d5-a716-cc43a266b43b@gmail.com \
--to=akiyks@gmail.com \
--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