diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2020-06-30 11:21:46 +0200 |
---|---|---|
committer | Bartosz Golaszewski <bgolaszewski@baylibre.com> | 2020-06-30 12:39:14 +0200 |
commit | ae66eca000cfef3ef0e31842102e17b1b660b1ce (patch) | |
tree | d8494c87966efb9b047880234fb375eaecaa86a2 /drivers/gpio/gpiolib.c | |
parent | gpio: omap: Add missing PM ops for suspend (diff) | |
download | linux-ae66eca000cfef3ef0e31842102e17b1b660b1ce.tar.xz linux-ae66eca000cfef3ef0e31842102e17b1b660b1ce.zip |
gpiolib: Deduplicate find_first_zero_bit() call
bitmap_full() is a shortcut to find_first_zero_bit().
Thus, no need to call it twice.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Diffstat (limited to 'drivers/gpio/gpiolib.c')
-rw-r--r-- | drivers/gpio/gpiolib.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 4fa075d49fbc..fa01455be4f0 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -3705,10 +3705,9 @@ int gpiod_get_array_value_complex(bool raw, bool can_sleep, bitmap_xor(value_bitmap, value_bitmap, array_info->invert_mask, array_size); - if (bitmap_full(array_info->get_mask, array_size)) - return 0; - i = find_first_zero_bit(array_info->get_mask, array_size); + if (i == array_size) + return 0; } else { array_info = NULL; } @@ -3989,10 +3988,9 @@ int gpiod_set_array_value_complex(bool raw, bool can_sleep, gpio_chip_set_multiple(array_info->chip, array_info->set_mask, value_bitmap); - if (bitmap_full(array_info->set_mask, array_size)) - return 0; - i = find_first_zero_bit(array_info->set_mask, array_size); + if (i == array_size) + return 0; } else { array_info = NULL; } |