Skip to content

Commit ccd428e

Browse files
commodoJonathan Cameron
authored andcommitted
iio: buffer: re-introduce bitmap_zalloc() for trialmask
Commit 3862828 ("iio: buffer: Switch to bitmap_zalloc()") introduced bitmap_alloc(), but commit 20ea39e ("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>
1 parent 7d744c8 commit ccd428e

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎drivers/iio/industrialio-buffer.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,8 +316,7 @@ static int iio_scan_mask_set(struct iio_dev *indio_dev,
316316
const unsigned long *mask;
317317
unsigned long *trialmask;
318318

319-
trialmask = kcalloc(BITS_TO_LONGS(indio_dev->masklength),
320-
sizeof(*trialmask), GFP_KERNEL);
319+
trialmask = bitmap_zalloc(indio_dev->masklength, GFP_KERNEL);
321320
if (trialmask == NULL)
322321
return -ENOMEM;
323322
if (!indio_dev->masklength) {

0 commit comments

Comments
 (0)