Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

iio: buffer: Save a few cycles in 'iio_scan_mask_set()'

Use 'bitmap_alloc()' instead of 'bitmap_zalloc()' because the bitmap
is fully overridden by a 'bitmap_copy()' call just after its allocation.

While at it, fix the style of a NULL check.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/89d8a766eb971eda1ee362444a8711037bdb208c.1626261211.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Christophe JAILLET and committed by
Jonathan Cameron
45851650 62f9eb70

+2 -2
+2 -2
drivers/iio/industrialio-buffer.c
··· 354 354 const unsigned long *mask; 355 355 unsigned long *trialmask; 356 356 357 - trialmask = bitmap_zalloc(indio_dev->masklength, GFP_KERNEL); 358 - if (trialmask == NULL) 357 + trialmask = bitmap_alloc(indio_dev->masklength, GFP_KERNEL); 358 + if (!trialmask) 359 359 return -ENOMEM; 360 360 if (!indio_dev->masklength) { 361 361 WARN(1, "Trying to set scanmask prior to registering buffer\n");