From: Jonathan Corbet <corbet@lwn.net>
To: "Uwe Kleine-König" <ukleinek@kernel.org>,
"Manuel Ebner" <manuelebner@mailbox.org>,
"Vlastimil Babka (SUSE)" <vbabka@kernel.org>,
"SeongJae Park" <sj@kernel.org>
Cc: Shuah Khan <skhan@linuxfoundation.org>,
workflows@vger.kernel.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Documentation: Fix syntax of kmalloc_objs example in coding style doc
Date: Mon, 01 Jun 2026 12:48:44 -0600 [thread overview]
Message-ID: <87fr369jw3.fsf@trenco.lwn.net> (raw)
In-Reply-To: <20260529081006.2019687-2-ukleinek@kernel.org>
Uwe Kleine-König <ukleinek@kernel.org> writes:
> The first parameter should match the variable that the allocated memory
> is assigned to. Fix the example accordingly, the one for kmalloc_obj got
> it right already.
>
> Fixes: 7c6d969d5349 ("Documentation: adopt new coding style of type-aware kmalloc-family")
> Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
> ---
> Documentation/process/coding-style.rst | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/process/coding-style.rst b/Documentation/process/coding-style.rst
> index a3bf75dc7c88..a8336582f60b 100644
> --- a/Documentation/process/coding-style.rst
> +++ b/Documentation/process/coding-style.rst
> @@ -959,13 +959,13 @@ The preferred form for allocating an array is the following:
>
> .. code-block:: c
>
> - p = kmalloc_objs(*ptr, n, ...);
> + p = kmalloc_objs(*p, n, ...);
>
> The preferred form for allocating a zeroed array is the following:
>
> .. code-block:: c
>
> - p = kzalloc_objs(*ptr, n, ...);
> + p = kzalloc_objs(*p, n, ...);
>
> Both forms check for overflow on the allocation size n * sizeof(...),
> and return NULL if that occurred.
Applied, thanks.
jon
next prev parent reply other threads:[~2026-06-01 18:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-29 8:10 [PATCH] Documentation: Fix syntax of kmalloc_objs example in coding style doc Uwe Kleine-König
2026-05-29 8:18 ` Geert Uytterhoeven
2026-06-01 18:48 ` Jonathan Corbet [this message]
2026-06-01 20:08 ` Kees Cook
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=87fr369jw3.fsf@trenco.lwn.net \
--to=corbet@lwn.net \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=manuelebner@mailbox.org \
--cc=sj@kernel.org \
--cc=skhan@linuxfoundation.org \
--cc=ukleinek@kernel.org \
--cc=vbabka@kernel.org \
--cc=workflows@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox