]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
Documentation: Fix syntax of kmalloc_objs example in coding style doc
authorUwe Kleine-König <ukleinek@kernel.org>
Fri, 29 May 2026 08:10:05 +0000 (10:10 +0200)
committerJonathan Corbet <corbet@lwn.net>
Mon, 1 Jun 2026 18:48:20 +0000 (12:48 -0600)
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>

Documentation/process/coding-style.rst

index a3bf75dc7c880e7afd8d7197fd5f40715fa7b8a1..a8336582f60bfaf19cf556bf6ea4e2d8330ea4e2 100644 (file)
@@ -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.