mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-28 12:53:14 +01:00
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: 7c6d969d53 ("Documentation: adopt new coding style of type-aware kmalloc-family")
Signed-off-by: Uwe Kleine-König <[email protected]>
Reviewed-by: Geert Uytterhoeven <[email protected]>
Signed-off-by: Jonathan Corbet <[email protected]>
Message-ID: <[email protected]>
This commit is contained in:
1 parent
344cc3d794
commit
323fa4b960
1 file changed
+2
-2
@@ -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.
|
||||
|
||||
Reference in new issue
Block a user