]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
staging: iio: Use kcalloc instead of kzalloc.
authorNavya Sri Nizamkari <navyasri.tech@gmail.com>
Tue, 10 Mar 2015 12:02:50 +0000 (17:32 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 15 Mar 2015 17:41:09 +0000 (18:41 +0100)
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>
drivers/staging/iio/adc/ad7280a.c

index 4d4870787eede59fd6a73d23ba4ca29df48bbe2e..e7d45ee2fac6cb24748e1abbd9f3971b7624f4b8 100644 (file)
@@ -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;