Commit ccd428e4 authored by Alexandru Ardelean's avatar Alexandru Ardelean Committed by Jonathan Cameron

iio: buffer: re-introduce bitmap_zalloc() for trialmask

Commit 3862828a ("iio: buffer: Switch to bitmap_zalloc()") introduced
bitmap_alloc(), but commit 20ea39ef ("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: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarAlexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 7d744c8f
...@@ -316,8 +316,7 @@ static int iio_scan_mask_set(struct iio_dev *indio_dev, ...@@ -316,8 +316,7 @@ static int iio_scan_mask_set(struct iio_dev *indio_dev,
const unsigned long *mask; const unsigned long *mask;
unsigned long *trialmask; unsigned long *trialmask;
trialmask = kcalloc(BITS_TO_LONGS(indio_dev->masklength), trialmask = bitmap_zalloc(indio_dev->masklength, GFP_KERNEL);
sizeof(*trialmask), GFP_KERNEL);
if (trialmask == NULL) if (trialmask == NULL)
return -ENOMEM; return -ENOMEM;
if (!indio_dev->masklength) { if (!indio_dev->masklength) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment