Re: [PATCH v3 14/20] iio: adc: xilinx-xadc-core: use devm_kmemdup_array()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Feb 03, 2025 at 01:38:56PM +0530, Raag Jadav wrote:
> Convert to use devm_kmemdup_array() which is more robust.

...

> -	channels = devm_kmemdup(dev, channel_templates,
> -				sizeof(channels[0]) * max_channels, GFP_KERNEL);
> +	channels = devm_kmemdup_array(dev, channel_templates, max_channels,
> +				      sizeof(channels[0]), GFP_KERNEL);

I would use more regular sizeof(*channels)

>  	if (!channels)
>  		return -ENOMEM;

P.S. For all sizeof() replacements the changes would probably need the updated
commit messages.

-- 
With Best Regards,
Andy Shevchenko






[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux