Linux Documentation
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <ukleinek@kernel.org>
To: Jonathan Corbet <corbet@lwn.net>,
	Manuel Ebner <manuelebner@mailbox.org>,
	"Vlastimil Babka (SUSE)" <vbabka@kernel.org>,
	SeongJae Park <sj@kernel.org>
Cc: Shuah Khan <skhan@linuxfoundation.org>,
	workflows@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH] Documentation: Fix syntax of kmalloc_objs example in coding style doc
Date: Fri, 29 May 2026 10:10:05 +0200	[thread overview]
Message-ID: <20260529081006.2019687-2-ukleinek@kernel.org> (raw)

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>
---
 Documentation/process/coding-style.rst | 4 ++--
 1 file 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.

base-commit: f7af91adc230aa99e23330ecf85bc9badd9780ad
-- 
2.47.3


             reply	other threads:[~2026-05-29  8:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-29  8:10 Uwe Kleine-König [this message]
2026-05-29  8:18 ` [PATCH] Documentation: Fix syntax of kmalloc_objs example in coding style doc Geert Uytterhoeven
2026-06-01 18:48 ` Jonathan Corbet
2026-06-01 20:08 ` Kees Cook

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260529081006.2019687-2-ukleinek@kernel.org \
    --to=ukleinek@kernel.org \
    --cc=corbet@lwn.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manuelebner@mailbox.org \
    --cc=sj@kernel.org \
    --cc=skhan@linuxfoundation.org \
    --cc=vbabka@kernel.org \
    --cc=workflows@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox