From: Claudiu Beznea <claudiu.beznea@tuxon.dev>
To: Sidharth Seela <sidharthseela@gmail.com>,
mturquette@baylibre.com, sboyd@kernel.org,
nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com,
varshini.rajendran@microchip.com
Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, skhan@linuxfoundation.org,
david.hunter.linux@gmail.com
Subject: Re: [PATCH RESEND] clk: at91: sam9x7: Use kmalloc_array() instead of kmalloc()
Date: Sat, 8 Nov 2025 12:00:01 +0200 [thread overview]
Message-ID: <2aaf169a-3dab-4ddc-a095-396619983406@tuxon.dev> (raw)
In-Reply-To: <20250924145552.55058-1-sidharthseela@gmail.com>
Hi, Sidharth,
On 9/24/25 17:55, Sidharth Seela wrote:
> Replace kmalloc with kmalloc array in clk/at91/sam9x7.c. Refactor to new
> API, for cases with dynamic size calculations inside kmalloc().
>
> Resend is to correct previously sent patches mailing address.
>
> Signed-off-by: Sidharth Seela <sidharthseela@gmail.com>
> ---
> diff --git a/drivers/clk/at91/sam9x7.c b/drivers/clk/at91/sam9x7.c
> index ffab32b047a0..0c0a746a183d 100644
> --- a/drivers/clk/at91/sam9x7.c
> +++ b/drivers/clk/at91/sam9x7.c
> @@ -748,9 +748,9 @@ static void __init sam9x7_pmc_setup(struct device_node *np)
> if (!sam9x7_pmc)
> return;
>
> - clk_mux_buffer = kmalloc(sizeof(void *) *
> - (ARRAY_SIZE(sam9x7_gck)),
> - GFP_KERNEL);
> + clk_mux_buffer = kmalloc_array(ARRAY_SIZE(sam9x7_gck),
> + sizeof(void *),
sizeof(*clk_mux_buffer)
Also, this line should be aligned on the above "(". Please run checkpatch.pl.
Could you please update the other at91 clock drivers?
[1]
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/coding-style.rst
> + GFP_KERNEL);
This like could fit on the above one.
Thank you,
Claudiu
> if (!clk_mux_buffer)
> goto err_free;
>
prev parent reply other threads:[~2025-11-08 10:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-24 14:55 Sidharth Seela
2025-10-07 21:06 ` Shuah Khan
2025-10-08 3:37 ` Sidharth Seela
2025-11-08 10:00 ` Claudiu Beznea [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=2aaf169a-3dab-4ddc-a095-396619983406@tuxon.dev \
--to=claudiu.beznea@tuxon.dev \
--cc=alexandre.belloni@bootlin.com \
--cc=david.hunter.linux@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=nicolas.ferre@microchip.com \
--cc=sboyd@kernel.org \
--cc=sidharthseela@gmail.com \
--cc=skhan@linuxfoundation.org \
--cc=varshini.rajendran@microchip.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
all inboxes | Powered by JetHome®