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. Raag
- Follow-Ups:
- Re: [PATCH v3 14/20] iio: adc: xilinx-xadc-core: use devm_kmemdup_array()
- From: Andy Shevchenko
- Re: [PATCH v3 14/20] iio: adc: xilinx-xadc-core: use devm_kmemdup_array()
- From: Jonathan Cameron
- Re: [PATCH v3 14/20] iio: adc: xilinx-xadc-core: use devm_kmemdup_array()
- References:
- [PATCH v3 00/20] Split devres APIs to device/devres.h and introduce devm_kmemdup_array()
- From: Raag Jadav
- [PATCH v3 14/20] iio: adc: xilinx-xadc-core: use devm_kmemdup_array()
- From: Raag Jadav
- Re: [PATCH v3 14/20] iio: adc: xilinx-xadc-core: use devm_kmemdup_array()
- From: Andy Shevchenko
- [PATCH v3 00/20] Split devres APIs to device/devres.h and introduce devm_kmemdup_array()
- Prev by Date: Re: [PATCH v3 12/20] regulator: cros-ec: use devm_kmemdup_array()
- Next by Date: [PATCH V2] ASoC: tegra: Add interconnect support
- Previous by thread: Re: [PATCH v3 14/20] iio: adc: xilinx-xadc-core: use devm_kmemdup_array()
- Next by thread: Re: [PATCH v3 14/20] iio: adc: xilinx-xadc-core: use devm_kmemdup_array()
- Index(es):
![]() |