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

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
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;