summaryrefslogtreecommitdiffstats
path: root/drivers/iio/industrialio-buffer.c
diff options
context:
space:
mode:
authorAlexandru Ardelean <alexandru.ardelean@analog.com>2020-03-21 09:59:56 +0100
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2020-04-19 17:56:13 +0200
commitccd428e42b807a1269d0477dd89c90136065617c (patch)
treecb5339c972b552f4fe334c9865e803c402f64b68 /drivers/iio/industrialio-buffer.c
parentMAINTAINERS: Add Syed Nayyar Waris to ACCES 104-QUAD-8 driver (diff)
downloadlinux-ccd428e42b807a1269d0477dd89c90136065617c.tar.xz
linux-ccd428e42b807a1269d0477dd89c90136065617c.zip
iio: buffer: re-introduce bitmap_zalloc() for trialmask
Commit 3862828a903d3 ("iio: buffer: Switch to bitmap_zalloc()") introduced bitmap_alloc(), but commit 20ea39ef9f2f9 ("iio: Fix scan mask selection") reverted it. This change adds it back. The only difference is that it's adding bitmap_zalloc(). There might be some changes later that would require initializing it to zero. In any case, now it's already zero-ing the trialmask. Appears to have been the result of merge conflict resolution rather than an intentional revert. Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/industrialio-buffer.c')
-rw-r--r--drivers/iio/industrialio-buffer.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c
index 4ada5592aa2b..5ff34ce8b6a2 100644
--- a/drivers/iio/industrialio-buffer.c
+++ b/drivers/iio/industrialio-buffer.c
@@ -316,8 +316,7 @@ static int iio_scan_mask_set(struct iio_dev *indio_dev,
const unsigned long *mask;
unsigned long *trialmask;
- trialmask = kcalloc(BITS_TO_LONGS(indio_dev->masklength),
- sizeof(*trialmask), GFP_KERNEL);
+ trialmask = bitmap_zalloc(indio_dev->masklength, GFP_KERNEL);
if (trialmask == NULL)
return -ENOMEM;
if (!indio_dev->masklength) {