From: SeongJae Park <sj@kernel.org>
To: Manuel Ebner <manuelebner@mailbox.org>
Cc: SeongJae Park <sj@kernel.org>, Jonathan Corbet <corbet@lwn.net>,
Shuah Khan <skhan@linuxfoundation.org>,
linux-doc@vger.kernel.org, Kees Cook <kees@kernel.org>,
linux-kernel@vger.kernel.org, workflows@vger.kernel.org,
linux-mm@kvack.org, Geert Uytterhoeven <geert@linux-m68k.org>
Subject: Re: [PATCH v4 3/3] Documentation: deprecated.rst: kmalloc-family: mark argument as optional
Date: Wed, 29 Apr 2026 18:03:32 -0700 [thread overview]
Message-ID: <20260430010332.114100-1-sj@kernel.org> (raw)
In-Reply-To: <20260429072704.311603-2-manuelebner@mailbox.org>
On Wed, 29 Apr 2026 09:27:04 +0200 Manuel Ebner <manuelebner@mailbox.org> wrote:
> put the optional argument (gfp) in square brackets
> add default value = GFP_KERNEL
>
> eg. ptr = kmalloc_obj(*ptr, gfp);
> -> ptr = kmalloc_obj(*ptr [, gfp] );
>
> Signed-off-by: Manuel Ebner <manuelebner@mailbox.org>
I have a trivial question below, but because it is trivial,
Acked-by: SeongJae Park <sj@kernel.org>
> ---
> Documentation/process/deprecated.rst | 15 ++++++++-------
> 1 file changed, 8 insertions(+), 7 deletions(-)
>
> diff --git a/Documentation/process/deprecated.rst b/Documentation/process/deprecated.rst
> index fed56864d036..ac75b7ecac47 100644
> --- a/Documentation/process/deprecated.rst
> +++ b/Documentation/process/deprecated.rst
> @@ -392,13 +392,14 @@ allocations. For example, these open coded assignments::
>
> become, respectively::
>
> - ptr = kmalloc_obj(*ptr, gfp);
> - ptr = kzalloc_obj(*ptr, gfp);
> - ptr = kmalloc_objs(*ptr, count, gfp);
> - ptr = kzalloc_objs(*ptr, count, gfp);
> - ptr = kmalloc_flex(*ptr, flex_member, count, gfp);
> - __auto_type ptr = kmalloc_obj(struct foo, gfp);
> -
> + ptr = kmalloc_obj(*ptr [, gfp] );
> + ptr = kzalloc_obj(*ptr [, gfp] );
> + ptr = kmalloc_objs(*ptr, count [, gfp] );
> + ptr = kzalloc_objs(*ptr, count [, gfp] );
> + ptr = kmalloc_flex(*ptr, flex_member, count [, gfp] );
> + __auto_type ptr = kmalloc_obj(struct foo [, gfp] );
> +
> +The argument gfp is optional, the default value is GFP_KERNEL.
> If `ptr->flex_member` is annotated with __counted_by(), the allocation
> will automatically fail if `count` is larger than the maximum
> representable value that can be stored in the counter member associated
Like 'ptr->flex_member' and 'count', why don't you enclose 'gfp' and
'GFP_KERNEL' with backticks ('`')?
Thanks,
SJ
[...]
next prev parent reply other threads:[~2026-04-30 1:03 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-29 7:08 [PATCH v4 0/3] Documentation: adopt new coding style of type-aware kmalloc-family Manuel Ebner
2026-04-29 7:14 ` [PATCH v4 1/3] " Manuel Ebner
2026-04-29 8:00 ` Vlastimil Babka
2026-04-30 0:53 ` SeongJae Park
2026-04-30 1:00 ` SeongJae Park
2026-05-01 9:12 ` Manuel Ebner
2026-04-29 7:27 ` [PATCH v4 3/3] Documentation: deprecated.rst: kmalloc-family: mark argument as optional Manuel Ebner
2026-04-29 8:01 ` Vlastimil Babka
2026-04-30 1:03 ` SeongJae Park [this message]
2026-05-01 9:19 ` Manuel Ebner
2026-05-03 14:56 ` [PATCH v4 0/3] Documentation: adopt new coding style of type-aware kmalloc-family Jonathan Corbet
2026-05-03 15:47 ` Manuel Ebner
2026-05-03 15:51 ` Jonathan Corbet
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=20260430010332.114100-1-sj@kernel.org \
--to=sj@kernel.org \
--cc=corbet@lwn.net \
--cc=geert@linux-m68k.org \
--cc=kees@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=manuelebner@mailbox.org \
--cc=skhan@linuxfoundation.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