public inbox for linux-kernel-mentees@lists.linux-foundation.org
 help / color / mirror / Atom feed
From: Manuel Ebner <manuelebner@mailbox.org>
To: kernel-janitors@vger.kernel.org,
	linux-kernel-mentees@lists.linux.dev,
	linux-newbie@vger.kernel.org
Cc: Manuel Ebner <manuelebner@mailbox.org>
Subject: [PATCH v2 0/3] Documentation: adopt new coding style of type-aware kmalloc-family
Date: Mon, 20 Apr 2026 18:42:35 +0200	[thread overview]
Message-ID: <20260420164234.217133-2-manuelebner@mailbox.org> (raw)

Update the documentation to reflect new type-aware kmalloc-family as
suggested in commit 2932ba8d9c99 ("slab: Introduce kmalloc_obj() and family")

ptr = kmalloc(sizeof(*ptr), gfp);
 -> ptr = kmalloc_obj(*ptr);
ptr = kmalloc(sizeof(struct some_obj_name), gfp);
 -> ptr = kmalloc_obj(*ptr);
ptr = kzalloc(sizeof(*ptr), gfp);
 -> ptr = kzalloc_obj(*ptr);
ptr = kmalloc_array(count, sizeof(*ptr), gfp);
 -> ptr = kmalloc_objs(*ptr, count);
ptr = kcalloc(count, sizeof(*ptr), gfp);
 -> ptr = kzalloc_objs(*ptr, count);

I have also thought about adding a few cases to checkpatch.pl, but this
will take me more time, and i want to get this series finished.

 [v1] -> [v2]:
put RCU/* in a seperate patch [Patch 2/3]
Remove GFP_KERNEL as suggested by https://lwn.net/Articles/1062856/
deprecated.rst: change the argument gfp to optional [Patch 3/3]

Signed-off-by: Manuel Ebner <manuelebner@mailbox.org>

             reply	other threads:[~2026-04-20 16:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-20 16:42 Manuel Ebner [this message]
2026-04-20 16:45 ` [PATCH] [PATCH v2 1/3] Documentation: adopt new coding style of type-aware kmalloc-family Manuel Ebner
2026-04-20 16:48 ` [PATCH v2 2/3] Documentation: RCU: " Manuel Ebner
2026-04-20 16:50 ` [PATCH v2 3/3] Documentation: deprecated.rst: type-aware kmalloc-family: mark optional argument as such Manuel Ebner

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=20260420164234.217133-2-manuelebner@mailbox.org \
    --to=manuelebner@mailbox.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel-mentees@lists.linux.dev \
    --cc=linux-newbie@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