Re: [PATCH v3 3/3] Documentation: deprecated.rst: kmalloc-family: mark argument as optional
From: Manuel Ebner
Date: Mon Jul 20 2026 - 04:39:16 EST
On Mon, 2026-04-27 at 03:51 -0600, Jonathan Corbet wrote:
> Manuel Ebner <manuelebner@xxxxxxxxxxx> writes:
>
> > put the optional argument (gfp) in square brackets
> > add whitespace for readability
> >
> > eg. ptr = kmalloc_obj(*ptr, gfp);
> > -> ptr = kmalloc_obj(*ptr [, gfp] );
> >
> > Signed-off-by: Manuel Ebner <manuelebner@xxxxxxxxxxx>
> > ---
> > Documentation/process/deprecated.rst | 12 ++++++------
> > 1 file changed, 6 insertions(+), 6 deletions(-)
> >
> > diff --git a/Documentation/process/deprecated.rst
> > b/Documentation/process/deprecated.rst
> > index fed56864d036..b431993fd08e 100644
> > --- a/Documentation/process/deprecated.rst
> > +++ b/Documentation/process/deprecated.rst
> > @@ -392,12 +392,12 @@ 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] );
> >
>
> Marking the GFP argument as optional is fine, but the documentation
> should surely say what the default is.
>
> There are, of course, other kmalloc()-related entries in that file that
> could use an update, but that is a job for another time, I guess.
KTODO: Update the sections suggesting to use th deprecated
kamlloc(_array)() functions.
Thanks
Manuel
> Thanks,
>
> jon