]> 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:04:29 +0000 (17:34 +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/accel/lis3l02dq_ring.c

index 1fd90090a633580dbc2dbbd1cd985ffc06d49f8e..e6101bbc7fbda9d768d54f6e6ab042caae7349e1 100644 (file)
@@ -118,7 +118,7 @@ static int lis3l02dq_get_buffer_element(struct iio_dev *indio_dev,
        int scan_count = bitmap_weight(indio_dev->active_scan_mask,
                                       indio_dev->masklength);
 
-       rx_array = kzalloc(4 * scan_count, GFP_KERNEL);
+       rx_array = kcalloc(4, scan_count, GFP_KERNEL);
        if (rx_array == NULL)
                return -ENOMEM;
        ret = lis3l02dq_read_all(indio_dev, rx_array);