diff options
author | Darshana Padmadas <darshanapadmadas@gmail.com> | 2014-09-20 18:30:19 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-09-22 07:58:47 -0700 |
commit | 5b12d0ac20dd9084995d10e1ec5bd43b7ec90f41 (patch) | |
tree | 499ef4d86676bdcdacf7a1c596f5185e3fcf886e | |
parent | 8deab4754c478149f8a139d6f54dc8b3ff665724 (diff) |
Staging: iio: adc: Fix warning prefer kmalloc_array over kmalloc
This patch fixes the checkpatch warning:
WARNING: Prefer kmalloc_array over kmalloc with multiply
kmalloc_array is preffered for allocating for arrays.
Signed-off-by: Darshana Padmadas <darshanapadmadas@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/iio/adc/mxs-lradc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/iio/adc/mxs-lradc.c b/drivers/staging/iio/adc/mxs-lradc.c index 468327f4a753..75fcb72911f1 100644 --- a/drivers/staging/iio/adc/mxs-lradc.c +++ b/drivers/staging/iio/adc/mxs-lradc.c @@ -1280,7 +1280,7 @@ static int mxs_lradc_buffer_preenable(struct iio_dev *iio) if (!ret) return -EBUSY; - lradc->buffer = kmalloc(len * sizeof(*lradc->buffer), GFP_KERNEL); + lradc->buffer = kmalloc_array(len, sizeof(*lradc->buffer), GFP_KERNEL); if (!lradc->buffer) { ret = -ENOMEM; goto err_mem; |