Re: [PATCH v3 3/3] Documentation: deprecated.rst: kmalloc-family: mark argument as optional
Manuel Ebner <[email protected]> Mon, 20 Jul 2026 10:38:45 +0200
| Newsgroups | org.kernel.vger.workflows,org.kernel.vger.kernel-janitors,org.kernel.vger.linux-doc,org.kernel.vger.linux-kernel,org.kvack.linux-mm |
|---|---|
| Message-ID | <[email protected]> |
On Mon, 2026-04-27 at 03:51 -0600, Jonathan Corbet wrote: > Manuel Ebner <[email protected]> writes: >=20 > > put the optional argument (gfp) in square brackets > > add whitespace for readability > >=20 > > eg. ptr =3D kmalloc_obj(*ptr, gfp); > > =C2=A0-> ptr =3D kmalloc_obj(*ptr [, gfp] ); > >=20 > > Signed-off-by: Manuel Ebner <[email protected]> > > --- > > =C2=A0Documentation/process/deprecated.rst | 12 ++++++------ > > =C2=A01 file changed, 6 insertions(+), 6 deletions(-) > >=20 > > 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 assign= ments:: > > =C2=A0 > > =C2=A0become, respectively:: > > =C2=A0 > > - ptr =3D kmalloc_obj(*ptr, gfp); > > - ptr =3D kzalloc_obj(*ptr, gfp); > > - ptr =3D kmalloc_objs(*ptr, count, gfp); > > - ptr =3D kzalloc_objs(*ptr, count, gfp); > > - ptr =3D kmalloc_flex(*ptr, flex_member, count, gfp); > > - __auto_type ptr =3D kmalloc_obj(struct foo, gfp); > > + ptr =3D kmalloc_obj(*ptr [, gfp] ); > > + ptr =3D kzalloc_obj(*ptr [, gfp] ); > > + ptr =3D kmalloc_objs(*ptr, count [, gfp] ); > > + ptr =3D kzalloc_objs(*ptr, count [, gfp] ); > > + ptr =3D kmalloc_flex(*ptr, flex_member, count [, gfp] ); > > + __auto_type ptr =3D kmalloc_obj(struct foo [, gfp] ); > > =C2=A0 >=20 > Marking the GFP argument as optional is fine, but the documentation > should surely say what the default is. >=20 > 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, >=20 > jon