Commit 3bde4d26 authored by Alexander Shiyan's avatar Alexander Shiyan Committed by Linus Walleij

gpio: rc5t583: Remove redundant check

Variable "offset" cannot be negative, so no need to check if it
greater than zero or equal.
Signed-off-by: default avatarAlexander Shiyan <shc_work@mail.ru>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 58c0f5aa
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment