Skip to content

Commit a0d78ee

Browse files
raagjadavandy-shev
authored andcommitted
iio: adc: xilinx-xadc-core: use devm_kmemdup_array()
Convert to use devm_kmemdup_array() and while at it, use source size instead of destination. Signed-off-by: Raag Jadav <raag.jadav@intel.com> Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
1 parent 86068ac commit a0d78ee

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/iio/adc/xilinx-xadc-core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1245,8 +1245,8 @@ static int xadc_parse_dt(struct iio_dev *indio_dev, unsigned int *conf, int irq)
12451245
channel_templates = xadc_us_channels;
12461246
max_channels = ARRAY_SIZE(xadc_us_channels);
12471247
}
1248-
channels = devm_kmemdup(dev, channel_templates,
1249-
sizeof(channels[0]) * max_channels, GFP_KERNEL);
1248+
channels = devm_kmemdup_array(dev, channel_templates, max_channels,
1249+
sizeof(*channel_templates), GFP_KERNEL);
12501250
if (!channels)
12511251
return -ENOMEM;
12521252

0 commit comments

Comments
 (0)