Re: [PATCH v3 12/20] regulator: cros-ec: use devm_kmemdup_array()

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

 



On Mon, Feb 03, 2025 at 11:51:10AM +0200, Andy Shevchenko wrote:
> On Mon, Feb 03, 2025 at 01:38:54PM +0530, Raag Jadav wrote:
> > Convert to use devm_kmemdup_array() which is more robust.
> 
> ...
> 
> >  	data->voltages_mV =
> > -		devm_kmemdup(dev, resp.voltages_mv,
> > -			     sizeof(u16) * data->num_voltages, GFP_KERNEL);
> > +		devm_kmemdup_array(dev, resp.voltages_mv, data->num_voltages,
> > +				   sizeof(u16), GFP_KERNEL);
> 
> Wondering if this can be sizeof(*data->voltages_mV) that makes code robust
> against type changes.

True, but I opted for a blind treewide conversion that is consistent with
existing driver conventions. Perhaps a better place for it is a separate
filewide series?

Raag




[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux