Re: [PATCH v4 1/3] Documentation: adopt new coding style of type-aware kmalloc-family
From: SeongJae Park
Date: Wed Apr 29 2026 - 20:53:51 EST
On Wed, 29 Apr 2026 09:14:44 +0200 Manuel Ebner <manuelebner@xxxxxxxxxxx> wrote:
> Update the documentation to reflect new type-aware kmalloc-family as
> suggested in commit 2932ba8d9c99 ("slab: Introduce kmalloc_obj()
> and family")
>
> ptr = kmalloc(sizeof(*ptr), gfp);
> -> ptr = kmalloc_obj(*ptr);
> ptr = kmalloc(sizeof(struct some_obj_name), gfp);
> -> ptr = kmalloc_obj(*ptr);
> ptr = kzalloc(sizeof(*ptr), gfp);
> -> ptr = kzalloc_obj(*ptr);
> ptr = kmalloc_array(count, sizeof(*ptr), gfp);
> -> ptr = kmalloc_objs(*ptr, count);
> ptr = kcalloc(count, sizeof(*ptr), gfp);
> -> ptr = kzalloc_objs(*ptr, count);
>
> Signed-off-by: Manuel Ebner <manuelebner@xxxxxxxxxxx>
Acked-by: SeongJae Park <sj@xxxxxxxxxx>
Thanks,
SJ
[...]