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, 3 Feb 2025 12:42:36 +0200
Raag Jadav <raag.jadav@xxxxxxxxx> wrote:

> On Mon, Feb 03, 2025 at 11:54:42AM +0200, Andy Shevchenko wrote:
> > 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)  
> 
> This might get confusing since we're assigning it back to channels.
> 
It looks like standard pattern.  Assign X * the thing to the thing.

So I'd prefer sizeof(*channels) here as well.

> 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