linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 1/1] gpiolib: Drop duplicate offset check in gpiochip_is_requested()
@ 2021-05-10 19:52 Andy Shevchenko
  2021-05-19 23:32 ` Linus Walleij
  2021-05-21 12:51 ` Bartosz Golaszewski
  0 siblings, 2 replies; 3+ messages in thread
From: Andy Shevchenko @ 2021-05-10 19:52 UTC (permalink / raw)
  To: Kent Gibson, linux-gpio, linux-kernel
  Cc: Linus Walleij, Bartosz Golaszewski, Andy Shevchenko

gpiochip_get_desc() already does the check, drop a duplicate in
gpiochip_is_requested().

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/gpio/gpiolib.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 1427c1be749b..220a9d8dd4e3 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -2004,9 +2004,6 @@ const char *gpiochip_is_requested(struct gpio_chip *gc, unsigned int offset)
 {
 	struct gpio_desc *desc;
 
-	if (offset >= gc->ngpio)
-		return NULL;
-
 	desc = gpiochip_get_desc(gc, offset);
 	if (IS_ERR(desc))
 		return NULL;
-- 
2.30.2


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

* Re: [PATCH v1 1/1] gpiolib: Drop duplicate offset check in gpiochip_is_requested()
  2021-05-10 19:52 [PATCH v1 1/1] gpiolib: Drop duplicate offset check in gpiochip_is_requested() Andy Shevchenko
@ 2021-05-19 23:32 ` Linus Walleij
  2021-05-21 12:51 ` Bartosz Golaszewski
  1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2021-05-19 23:32 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Kent Gibson, open list:GPIO SUBSYSTEM, linux-kernel, Bartosz Golaszewski

On Mon, May 10, 2021 at 9:52 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:

> gpiochip_get_desc() already does the check, drop a duplicate in
> gpiochip_is_requested().
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

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

* Re: [PATCH v1 1/1] gpiolib: Drop duplicate offset check in gpiochip_is_requested()
  2021-05-10 19:52 [PATCH v1 1/1] gpiolib: Drop duplicate offset check in gpiochip_is_requested() Andy Shevchenko
  2021-05-19 23:32 ` Linus Walleij
@ 2021-05-21 12:51 ` Bartosz Golaszewski
  1 sibling, 0 replies; 3+ messages in thread
From: Bartosz Golaszewski @ 2021-05-21 12:51 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: Kent Gibson, linux-gpio, LKML, Linus Walleij

On Mon, May 10, 2021 at 9:52 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> gpiochip_get_desc() already does the check, drop a duplicate in
> gpiochip_is_requested().
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/gpio/gpiolib.c | 3 ---
>  1 file changed, 3 deletions(-)
>
> diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
> index 1427c1be749b..220a9d8dd4e3 100644
> --- a/drivers/gpio/gpiolib.c
> +++ b/drivers/gpio/gpiolib.c
> @@ -2004,9 +2004,6 @@ const char *gpiochip_is_requested(struct gpio_chip *gc, unsigned int offset)
>  {
>         struct gpio_desc *desc;
>
> -       if (offset >= gc->ngpio)
> -               return NULL;
> -
>         desc = gpiochip_get_desc(gc, offset);
>         if (IS_ERR(desc))
>                 return NULL;
> --
> 2.30.2
>

I applied this some time ago just forgot to comment here.

Bart

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

end of thread, other threads:[~2021-05-21 12:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-10 19:52 [PATCH v1 1/1] gpiolib: Drop duplicate offset check in gpiochip_is_requested() Andy Shevchenko
2021-05-19 23:32 ` Linus Walleij
2021-05-21 12:51 ` Bartosz Golaszewski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).