public inbox for linux-kernel-mentees@lists.linux-foundation.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Mehdi Ben Hadj Khelifa <mehdi.benhadjkhelifa@gmail.com>
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	 skhan@linuxfoundation.org, david.hunter.linux@gmail.com,
	khalid@kernel.org,
	 linux-kernel-mentees@lists.linuxfoundation.org
Subject: Re: [PATCH] blk-mq: use struct_size() in kmalloc()
Date: Mon, 20 Oct 2025 10:39:11 -0600	[thread overview]
Message-ID: <176097835143.28490.789079417051480319.b4-ty@kernel.dk> (raw)
In-Reply-To: <20251018213831.260055-1-mehdi.benhadjkhelifa@gmail.com>


On Sat, 18 Oct 2025 22:38:13 +0100, Mehdi Ben Hadj Khelifa wrote:
> Change struct size calculation to use struct_size()
> to align with new recommended practices[1] which quotes:
> "Another common case to avoid is calculating the size of a structure with
> a trailing array of others structures, as in:
> 
> header = kzalloc(sizeof(*header) + count * sizeof(*header->item),
>                  GFP_KERNEL);
> 
> [...]

Applied, thanks!

[1/1] blk-mq: use struct_size() in kmalloc()
      commit: e5a82249d88c7063c4ac998704b0ae5784013976

Best regards,
-- 
Jens Axboe




      reply	other threads:[~2025-10-20 16:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-18 21:38 [PATCH] blk-mq: use struct_size() in kmalloc() Mehdi Ben Hadj Khelifa
2025-10-20 16:39 ` Jens Axboe [this message]

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=176097835143.28490.789079417051480319.b4-ty@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=david.hunter.linux@gmail.com \
    --cc=khalid@kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel-mentees@lists.linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mehdi.benhadjkhelifa@gmail.com \
    --cc=skhan@linuxfoundation.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