gpio: gpiolib: remove shadowed variable
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Tue, 5 Jan 2021 10:59:14 +0000 (11:59 +0100)
committerBartosz Golaszewski <bgolaszewski@baylibre.com>
Mon, 1 Feb 2021 12:24:28 +0000 (13:24 +0100)
After refactoring, we had two variables for the same thing. Remove the
second declaration, one is enough here. Found by cppcheck.

drivers/gpio/gpiolib.c:2551:17: warning: Local variable 'ret' shadows outer variable [shadowVariable]

Fixes: d377f56f34f5 ("gpio: gpiolib: Normalize return code variable name")
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
drivers/gpio/gpiolib.c

index 3ba9c98..97eec8d 100644 (file)
@@ -2557,7 +2557,7 @@ int gpiod_get_array_value_complex(bool raw, bool can_sleep,
                struct gpio_chip *gc = desc_array[i]->gdev->chip;
                unsigned long fastpath[2 * BITS_TO_LONGS(FASTPATH_NGPIO)];
                unsigned long *mask, *bits;
-               int first, j, ret;
+               int first, j;
 
                if (likely(gc->ngpio <= FASTPATH_NGPIO)) {
                        mask = fastpath;