linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gpio: rc5t583: Remove redundant check
@ 2014-02-15 13:24 Alexander Shiyan
  2014-02-24 13:52 ` Linus Walleij
  0 siblings, 1 reply; 3+ messages in thread
From: Alexander Shiyan @ 2014-02-15 13:24 UTC (permalink / raw)
  To: linux-gpio; +Cc: Linus Walleij, Alexandre Courbot, Alexander Shiyan

Variable "offset" cannot be negative, so no need to check if it
greater than zero or equal.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 drivers/gpio/gpio-rc5t583.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-rc5t583.c b/drivers/gpio/gpio-rc5t583.c
index 122b776..9b42317 100644
--- a/drivers/gpio/gpio-rc5t583.c
+++ b/drivers/gpio/gpio-rc5t583.c
@@ -97,7 +97,7 @@ static int rc5t583_gpio_to_irq(struct gpio_chip *gc, unsigned offset)
 {
 	struct rc5t583_gpio *rc5t583_gpio = to_rc5t583_gpio(gc);
 
-	if ((offset >= 0) && (offset < 8))
+	if (offset < RC5T583_MAX_GPIO)
 		return rc5t583_gpio->rc5t583->irq_base +
 				RC5T583_IRQ_GPIO0 + offset;
 	return -EINVAL;
-- 
1.8.3.2


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

end of thread, other threads:[~2014-02-24 14:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-15 13:24 [PATCH] gpio: rc5t583: Remove redundant check Alexander Shiyan
2014-02-24 13:52 ` Linus Walleij
2014-02-24 14:20   ` Alexander Shiyan

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).