Documentation: Fix syntax of kmalloc_objs example in coding style doc
Subsystems (2)
PATCH 1/1 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.
--- Documentation/process/coding-style.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Documentation/process/coding-style.rst +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.
base-commit: f7af91adc230aa99e23330ecf85bc9badd9780ad
Signature · 1 line
2.47.3
Quoted 6 lines · Uwe Kleine-König
The first parameter should match the variable that the allocated memory is assigned to. Fix the example accordingly, the one for
kmalloc_objgot it right already.Fixes 7c6d969d5349 ("Documentation: adopt new coding style of type-aware kmalloc-family")Signed-off-by Uwe Kleine-König <[email protected]>
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
Quoted 20 lines · Uwe Kleine-König
The first parameter should match the variable that the allocated memory is assigned to. Fix the example accordingly, the one for
kmalloc_objgot it right already.Fixes 7c6d969d5349 ("Documentation: adopt new coding style of type-aware kmalloc-family")Signed-off-by Uwe Kleine-König <[email protected]>--- Documentation/process/coding-style.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)Documentation/process/coding-style.rst +1
-1@@ -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, ...);
Documentation/process/coding-style.rst The preferred form for allocating an array is the following: · line 971
Quoted 10 lines
Documentation/process/coding-style.rst +1
-1The 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.
Applied, thanks.
jon
Quoted 6 lines · Uwe Kleine-König
The first parameter should match the variable that the allocated memory is assigned to. Fix the example accordingly, the one for
kmalloc_objgot it right already.Fixes 7c6d969d5349 ("Documentation: adopt new coding style of type-aware kmalloc-family")Signed-off-by Uwe Kleine-König <[email protected]>
oops, thank you!
Signature · 1 line
Kees Cook
Thanks, I realized just now that I introduced this.
Manuel
Quoted 34 lines · Uwe Kleine-König
The first parameter should match the variable that the allocated memory is assigned to. Fix the example accordingly, the one for
kmalloc_objgot it right already.Fixes 7c6d969d5349 ("Documentation: adopt new coding style of type-aware kmalloc-family")
Signed-off-by Uwe Kleine-König <[email protected]>---
Documentation/process/coding-style.rst | 4 ++--1 file changed, 2 insertions(+), 2 deletions(-)Documentation/process/coding- renamed from Documentation/process/coding-style.rst +0
-0
style.rst
indexa3bf75dc7c88..a8336582f60b100644Documentation/process/coding-style.rst +0
-0@@ -959,13 +959,13 @@ The preferred form for allocating an array is the following:
.. code-block:: cDocumentation/process/coding-style.rst +1
-1- p = kmalloc_objs(*ptr, n, ...); + p = kmalloc_objs(*p, n, ...);
The preferred form for allocating a zeroed array is the following:
.. code-block:: cDocumentation/process/coding-style.rst +1
-1- 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.base-commit:
f7af91adc230aa99e23330ecf85bc9badd9780ad