All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gpio: gpiolib: remove shadowed variable
@ 2021-01-05 10:59 Wolfram Sang
  2021-01-05 11:14 ` Geert Uytterhoeven
  0 siblings, 1 reply; 6+ messages in thread
From: Wolfram Sang @ 2021-01-05 10:59 UTC (permalink / raw)
  To: linux-gpio; +Cc: linux-renesas-soc, Wolfram Sang

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>
---
 drivers/gpio/gpiolib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 611d6ea82d75..c354cc6ed826 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -2548,7 +2548,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;
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] gpio: gpiolib: remove shadowed variable
  2021-01-05 10:59 [PATCH] gpio: gpiolib: remove shadowed variable Wolfram Sang
@ 2021-01-05 11:14 ` Geert Uytterhoeven
  2021-01-27 10:39   ` Wolfram Sang
  0 siblings, 1 reply; 6+ messages in thread
From: Geert Uytterhoeven @ 2021-01-05 11:14 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: open list:GPIO SUBSYSTEM, Linux-Renesas

On Tue, Jan 5, 2021 at 12:00 PM Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
> 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>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] gpio: gpiolib: remove shadowed variable
  2021-01-05 11:14 ` Geert Uytterhoeven
@ 2021-01-27 10:39   ` Wolfram Sang
  2021-02-01  8:58     ` Bartosz Golaszewski
  0 siblings, 1 reply; 6+ messages in thread
From: Wolfram Sang @ 2021-01-27 10:39 UTC (permalink / raw)
  To: Geert Uytterhoeven, Linus Walleij, Bartosz Golaszewski
  Cc: open list:GPIO SUBSYSTEM, Linux-Renesas

[-- Attachment #1: Type: text/plain, Size: 659 bytes --]

On Tue, Jan 05, 2021 at 12:14:34PM +0100, Geert Uytterhoeven wrote:
> On Tue, Jan 5, 2021 at 12:00 PM Wolfram Sang
> <wsa+renesas@sang-engineering.com> wrote:
> > 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>
> 
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Ccing Linus & Bartosz


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] gpio: gpiolib: remove shadowed variable
  2021-01-27 10:39   ` Wolfram Sang
@ 2021-02-01  8:58     ` Bartosz Golaszewski
  2021-02-01  9:04       ` Geert Uytterhoeven
  0 siblings, 1 reply; 6+ messages in thread
From: Bartosz Golaszewski @ 2021-02-01  8:58 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Geert Uytterhoeven, Linus Walleij, open list:GPIO SUBSYSTEM,
	Linux-Renesas

On Wed, Jan 27, 2021 at 11:39 AM Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
>
> On Tue, Jan 05, 2021 at 12:14:34PM +0100, Geert Uytterhoeven wrote:
> > On Tue, Jan 5, 2021 at 12:00 PM Wolfram Sang
> > <wsa+renesas@sang-engineering.com> wrote:
> > > 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>
> >
> > Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
>
> Ccing Linus & Bartosz
>

For some reason this is not on patchwork and I also don't have it in
my inbox, can you resend, please?

Bart

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] gpio: gpiolib: remove shadowed variable
  2021-02-01  8:58     ` Bartosz Golaszewski
@ 2021-02-01  9:04       ` Geert Uytterhoeven
  2021-02-01 12:25         ` Bartosz Golaszewski
  0 siblings, 1 reply; 6+ messages in thread
From: Geert Uytterhoeven @ 2021-02-01  9:04 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Wolfram Sang, Linus Walleij, open list:GPIO SUBSYSTEM, Linux-Renesas

Hi Bartosz,

On Mon, Feb 1, 2021 at 9:59 AM Bartosz Golaszewski
<bgolaszewski@baylibre.com> wrote:
> On Wed, Jan 27, 2021 at 11:39 AM Wolfram Sang
> <wsa+renesas@sang-engineering.com> wrote:
> > On Tue, Jan 05, 2021 at 12:14:34PM +0100, Geert Uytterhoeven wrote:
> > > On Tue, Jan 5, 2021 at 12:00 PM Wolfram Sang
> > > <wsa+renesas@sang-engineering.com> wrote:
> > > > 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>
> > >
> > > Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> >
> > Ccing Linus & Bartosz
> >
>
> For some reason this is not on patchwork and I also don't have it in
> my inbox, can you resend, please?

https://lore.kernel.org/linux-gpio/20210105105914.13172-1-wsa+renesas@sang-engineering.com/

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] gpio: gpiolib: remove shadowed variable
  2021-02-01  9:04       ` Geert Uytterhoeven
@ 2021-02-01 12:25         ` Bartosz Golaszewski
  0 siblings, 0 replies; 6+ messages in thread
From: Bartosz Golaszewski @ 2021-02-01 12:25 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Wolfram Sang, Linus Walleij, open list:GPIO SUBSYSTEM, Linux-Renesas

On Mon, Feb 1, 2021 at 10:04 AM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>
> Hi Bartosz,
>
> On Mon, Feb 1, 2021 at 9:59 AM Bartosz Golaszewski
> <bgolaszewski@baylibre.com> wrote:
> > On Wed, Jan 27, 2021 at 11:39 AM Wolfram Sang
> > <wsa+renesas@sang-engineering.com> wrote:
> > > On Tue, Jan 05, 2021 at 12:14:34PM +0100, Geert Uytterhoeven wrote:
> > > > On Tue, Jan 5, 2021 at 12:00 PM Wolfram Sang
> > > > <wsa+renesas@sang-engineering.com> wrote:
> > > > > 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>
> > > >
> > > > Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> > >
> > > Ccing Linus & Bartosz
> > >
> >
> > For some reason this is not on patchwork and I also don't have it in
> > my inbox, can you resend, please?
>
> https://lore.kernel.org/linux-gpio/20210105105914.13172-1-wsa+renesas@sang-engineering.com/
>
> Gr{oetje,eeting}s,
>
>                         Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds

Thanks, now applied. Please make sure to Cc Linus and I next time.

Bartosz

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-02-01 12:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-05 10:59 [PATCH] gpio: gpiolib: remove shadowed variable Wolfram Sang
2021-01-05 11:14 ` Geert Uytterhoeven
2021-01-27 10:39   ` Wolfram Sang
2021-02-01  8:58     ` Bartosz Golaszewski
2021-02-01  9:04       ` Geert Uytterhoeven
2021-02-01 12:25         ` Bartosz Golaszewski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.