]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
Documentation: adopt new coding style of type-aware kmalloc-family
authorManuel Ebner <manuelebner@mailbox.org>
Wed, 29 Apr 2026 07:14:44 +0000 (09:14 +0200)
committerJonathan Corbet <corbet@lwn.net>
Sun, 3 May 2026 14:54:21 +0000 (08:54 -0600)
commit7c6d969d5349c40348276d5c301b2d200afa623d
tree14bcf8c7ae8a9e3afc2af500b7ee3e607f2d3f9b
parente5ebf6278d06b55dadded317b92e351c03e05e6e
Documentation: adopt new coding style of type-aware kmalloc-family

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, gfp);
ptr = kmalloc(sizeof(struct some_obj_name), gfp);
 -> ptr = kmalloc_obj(*ptr, gfp);
ptr = kzalloc(sizeof(*ptr), gfp);
 -> ptr = kzalloc_obj(*ptr, gfp);
ptr = kmalloc_array(count, sizeof(*ptr), gfp);
 -> ptr = kmalloc_objs(*ptr, count, gfp);
ptr = kcalloc(count, sizeof(*ptr), gfp);
 -> ptr = kzalloc_objs(*ptr, count, gfp);

Signed-off-by: Manuel Ebner <manuelebner@mailbox.org>
Acked-by: SeongJae Park <sj@kernel.org>
Acked-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Message-ID: <20260429071445.309733-2-manuelebner@mailbox.org>
17 files changed:
Documentation/core-api/kref.rst
Documentation/core-api/list.rst
Documentation/driver-api/mailbox.rst
Documentation/driver-api/media/v4l2-fh.rst
Documentation/kernel-hacking/locking.rst
Documentation/locking/locktypes.rst
Documentation/process/coding-style.rst
Documentation/sound/kernel-api/writing-an-alsa-driver.rst
Documentation/spi/spi-summary.rst
Documentation/translations/it_IT/kernel-hacking/locking.rst
Documentation/translations/it_IT/locking/locktypes.rst
Documentation/translations/it_IT/process/coding-style.rst
Documentation/translations/sp_SP/process/coding-style.rst
Documentation/translations/zh_CN/core-api/kref.rst
Documentation/translations/zh_CN/process/coding-style.rst
Documentation/translations/zh_CN/video4linux/v4l2-framework.txt
Documentation/translations/zh_TW/process/coding-style.rst