[PATCH v1 2/4] clk: rockchip: Switch to use kmemdup_array()

Andy Shevchenko andriy.shevchenko at linux.intel.com
Tue Jun 11 06:20:05 PDT 2024


On Fri, Jun 07, 2024 at 10:13:04AM +0200, Heiko Stübner wrote:
> Am Donnerstag, 6. Juni 2024, 18:09:32 CEST schrieb Andy Shevchenko:

...

> > -		cpuclk->rate_table = kmemdup(rates,
> > -					     sizeof(*rates) * nrates,
> > -					     GFP_KERNEL);
> > +		cpuclk->rate_table = kmemdup_array(rates, nrates, sizeof(*rates),
> > +						   GFP_KERNEL);
> 
> are you sure the param order is correct?
> 
> According to [0], it's (src, element_size, count, gfp), while above
> (and below) element_size and count seems switched in the
> kmemdup_array calls.

I'm glad you asked. The parameter order is going to be fixed [1].

> [0] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/mm/util.c#n149

[1]: 0ee14725471c ("mm/util: Swap kmemdup_array() arguments")

-- 
With Best Regards,
Andy Shevchenko





More information about the Linux-rockchip mailing list