summaryrefslogtreecommitdiff
path: root/Documentation/process
diff options
context:
space:
mode:
authorUwe Kleine-König <ukleinek@kernel.org>2026-05-29 10:10:05 +0200
committerJonathan Corbet <corbet@lwn.net>2026-06-01 12:48:20 -0600
commit323fa4b9608b1c277ca7f97f81172aa56da76074 (patch)
tree45b397ba18b9226d67ed979e2a19e2ee5f169f45 /Documentation/process
parent344cc3d79494935e5ed1c5b2f2359022ff34fedc (diff)
downloadlwn-323fa4b9608b1c277ca7f97f81172aa56da76074.tar.gz
lwn-323fa4b9608b1c277ca7f97f81172aa56da76074.zip
Documentation: Fix syntax of kmalloc_objs example in coding style doc
The first parameter should match the variable that the allocated memory is assigned to. Fix the example accordingly, the one for kmalloc_obj got it right already. Fixes: 7c6d969d5349 ("Documentation: adopt new coding style of type-aware kmalloc-family") Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Message-ID: <20260529081006.2019687-2-ukleinek@kernel.org>
Diffstat (limited to 'Documentation/process')
-rw-r--r--Documentation/process/coding-style.rst4
1 files changed, 2 insertions, 2 deletions
diff --git a/Documentation/process/coding-style.rst b/Documentation/process/coding-style.rst
index a3bf75dc7c88..a8336582f60b 100644
--- a/Documentation/process/coding-style.rst
+++ b/Documentation/process/coding-style.rst
@@ -959,13 +959,13 @@ The preferred form for allocating an array is the following:
.. code-block:: c
- p = kmalloc_objs(*ptr, n, ...);
+ p = kmalloc_objs(*p, n, ...);
The preferred form for allocating a zeroed array is the following:
.. code-block:: c
- p = kzalloc_objs(*ptr, n, ...);
+ p = kzalloc_objs(*p, n, ...);
Both forms check for overflow on the allocation size n * sizeof(...),
and return NULL if that occurred.