From: Keith Busch <kbusch@kernel.org>
To: Yu-Chun Lin <eleanor15x@gmail.com>
Cc: hch@lst.de, sagi@grimberg.me, kch@nvidia.com,
linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org,
visitorckw@gmail.com, jserv@ccns.ncku.edu.tw,
kernel test robot <lkp@intel.com>
Subject: Re: [PATCH] nvmet: replace kmalloc + memset with kzalloc for data allocation
Date: Tue, 3 Dec 2024 11:03:05 -0800 [thread overview]
Message-ID: <Z09V6QHNxGS5FTyB@kbusch-mbp> (raw)
In-Reply-To: <20241130170258.103954-1-eleanor15x@gmail.com>
On Sun, Dec 01, 2024 at 01:02:58AM +0800, Yu-Chun Lin wrote:
> cocci warnings: (new ones prefixed by >>)
> >> drivers/nvme/target/pr.c:831:8-15: WARNING: kzalloc should be used for data, instead of kmalloc/memset
>
> The pattern of using 'kmalloc' followed by 'memset' is replaced with
> 'kzalloc', which is functionally equivalent to 'kmalloc' + 'memset',
> but more efficient. 'kzalloc' automatically zeroes the allocated
> memory, making it a faster and more streamlined solution.
Thanks, applied to nvme-6.13.
prev parent reply other threads:[~2024-12-03 19:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-30 17:02 [PATCH] nvmet: replace kmalloc + memset with kzalloc for data allocation Yu-Chun Lin
2024-12-03 0:36 ` Christoph Hellwig
2024-12-03 2:00 ` Chaitanya Kulkarni
2024-12-03 19:03 ` Keith Busch [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=Z09V6QHNxGS5FTyB@kbusch-mbp \
--to=kbusch@kernel.org \
--cc=eleanor15x@gmail.com \
--cc=hch@lst.de \
--cc=jserv@ccns.ncku.edu.tw \
--cc=kch@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=lkp@intel.com \
--cc=sagi@grimberg.me \
--cc=visitorckw@gmail.com \
/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