public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] Documentation: adopt new coding style of type-aware kmalloc-family
@ 2026-04-20 16:42 Manuel Ebner
  2026-04-20 16:45 ` [PATCH] [PATCH v2 1/3] " Manuel Ebner
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Manuel Ebner @ 2026-04-20 16:42 UTC (permalink / raw)
  To: kernel-janitors, linux-kernel-mentees, linux-newbie; +Cc: Manuel Ebner

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);

I have also thought about adding a few cases to checkpatch.pl, but this
will take me more time, and i want to get this series finished.

 [v1] -> [v2]:
put RCU/* in a seperate patch [Patch 2/3]
Remove GFP_KERNEL as suggested by https://lwn.net/Articles/1062856/
deprecated.rst: change the argument gfp to optional [Patch 3/3]

Signed-off-by: Manuel Ebner <manuelebner@mailbox.org>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-04-20 16:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-20 16:42 [PATCH v2 0/3] Documentation: adopt new coding style of type-aware kmalloc-family Manuel Ebner
2026-04-20 16:45 ` [PATCH] [PATCH v2 1/3] " Manuel Ebner
2026-04-20 16:48 ` [PATCH v2 2/3] Documentation: RCU: " Manuel Ebner
2026-04-20 16:50 ` [PATCH v2 3/3] Documentation: deprecated.rst: type-aware kmalloc-family: mark optional argument as such Manuel Ebner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox