diff options
| author | 2015-03-10 17:32:50 +0530 | |
|---|---|---|
| committer | 2015-03-15 18:41:09 +0100 | |
| commit | 7e026b647b27d3dc170bd335d5e9c4a6f45323ff (patch) | |
| tree | 773702e47f4ee58276a2ec1b5f32a65efb08dac6 | |
| parent | staging: iio: Use kcalloc instead of kzalloc (diff) | |
staging: iio: Use kcalloc instead of kzalloc.
This patch uses kcalloc instead of kzalloc function.
A coccinelle script was used to make this change.
Signed-off-by: Navya Sri Nizamkari <navyasri.tech@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| -rw-r--r-- | drivers/staging/iio/adc/ad7280a.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/staging/iio/adc/ad7280a.c b/drivers/staging/iio/adc/ad7280a.c index 4d4870787eed..e7d45ee2fac6 100644 --- a/drivers/staging/iio/adc/ad7280a.c +++ b/drivers/staging/iio/adc/ad7280a.c @@ -547,8 +547,9 @@ static int ad7280_attr_init(struct ad7280_state *st) { int dev, ch, cnt; - st->iio_attr = kzalloc(sizeof(*st->iio_attr) * (st->slave_num + 1) * - AD7280A_CELLS_PER_DEV * 2, GFP_KERNEL); + st->iio_attr = kcalloc(2, sizeof(*st->iio_attr) * + (st->slave_num + 1) * AD7280A_CELLS_PER_DEV, + GFP_KERNEL); if (st->iio_attr == NULL) return -ENOMEM; |
