Skip to contentSkip to conversation

Documentation: Fix syntax of kmalloc_objs example in coding style doc

PATCH Applied Uwe Kleine-König 5 participants 5 messages May 29 – Jun 18

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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.

Fixes 7c6d969d5349 ("Documentation: adopt new coding style of type-aware kmalloc-family")
---
 Documentation/process/coding-style.rst | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Documentation/process/coding-style.rst +2 -2
index a3bf75dc7c88..a8336582f60b 100644
@@ -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
Reviewed-by on v1 1/1
#1 lore raw
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_obj got it right already.

Fixes 7c6d969d5349 ("Documentation: adopt new coding style of type-aware kmalloc-family")

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
maintainer Applied
#2 lore raw
In reply to Uwe Kleine-König
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_obj got it right already.

Fixes 7c6d969d5349 ("Documentation: adopt new coding style of type-aware kmalloc-family")
---
 Documentation/process/coding-style.rst | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Documentation/process/coding-style.rst +1 -1
index a3bf75dc7c88..a8336582f60b 100644
@@ -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 -1
 
 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.

Applied, thanks.

jon

Reviewed-by on v1 1/1
#3 lore raw
In reply to Uwe Kleine-König
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_obj got it right already.

Fixes 7c6d969d5349 ("Documentation: adopt new coding style of type-aware kmalloc-family")

oops, thank you!

Signature · 1 line
Kees Cook
#4 lore raw
In reply to Uwe Kleine-König

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_obj got it right already.

Fixes 7c6d969d5349 ("Documentation: adopt new coding style of type-aware kmalloc-

family")

---
 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
index a3bf75dc7c88..a8336582f60b 100644

Documentation/process/coding-style.rst +0 -0
@@ -959,13 +959,13 @@ The preferred form for allocating an array is the following:


 .. code-block:: c

Documentation/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:: c

Documentation/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