From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
To: Ethan Carter Edwards <ethan@ethancedwards.com>,
"agk@redhat.com" <agk@redhat.com>
Cc: "snitzer@kernel.org" <snitzer@kernel.org>,
"dm-devel@lists.linux.dev" <dm-devel@lists.linux.dev>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"kernel-hardening@lists.openwall.com"
<kernel-hardening@lists.openwall.com>,
"linux-hardening@vger.kernel.org"
<linux-hardening@vger.kernel.org>,
"mpatocka@redhat.com" <mpatocka@redhat.com>
Subject: Re: [PATCH] dm: change kzalloc to kcalloc
Date: Tue, 24 Dec 2024 16:42:07 -0600 [thread overview]
Message-ID: <d38e99d7-1f24-4c7b-87de-111c345b02cf@embeddedor.com> (raw)
In-Reply-To: <Z7XWRfRi3Fn25wT4Dg19JRN4xrKcCt3TxaxZwsR_0LDR2C6fQxCiLrsMBfJg8f_ZqSAx3u6aPm-TR02dC6bLpMmqSI_jp_ADiJ_qW_27puk=@ethancedwards.com>
On 24/12/24 16:13, Ethan Carter Edwards wrote:
> Use 2-factor multiplication argument form kcalloc() instead
> of instead of the deprecated kzalloc() [1].
Thanks for the patch - Just note that kzalloc() is by no means
deprecated.
>
> [1] https://www.kernel.org/doc/html/next/process/deprecated.html#open-coded-arithmetic-in-allocator-arguments
> Link: https://github.com/KSPP/linux/issues/162
>
> Signed-off-by: Ethan Carter Edwards <ethan@ethancedwards.com>
Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
-Gustavo
> ---
> drivers/md/dm-ps-io-affinity.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/md/dm-ps-io-affinity.c b/drivers/md/dm-ps-io-affinity.c
> index 461ee6b2044d..716807e511ee 100644
> --- a/drivers/md/dm-ps-io-affinity.c
> +++ b/drivers/md/dm-ps-io-affinity.c
> @@ -116,7 +116,7 @@ static int ioa_create(struct path_selector *ps, unsigned int argc, char **argv)
> if (!s)
> return -ENOMEM;
>
> - s->path_map = kzalloc(nr_cpu_ids * sizeof(struct path_info *),
> + s->path_map = kcalloc(nr_cpu_ids, sizeof(struct path_info *),
> GFP_KERNEL);
> if (!s->path_map)
> goto free_selector;
prev parent reply other threads:[~2024-12-24 22:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-24 22:13 [PATCH] dm: change kzalloc to kcalloc Ethan Carter Edwards
2024-12-24 22:42 ` Gustavo A. R. Silva [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=d38e99d7-1f24-4c7b-87de-111c345b02cf@embeddedor.com \
--to=gustavo@embeddedor.com \
--cc=agk@redhat.com \
--cc=dm-devel@lists.linux.dev \
--cc=ethan@ethancedwards.com \
--cc=kernel-hardening@lists.openwall.com \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mpatocka@redhat.com \
--cc=snitzer@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