[U-Boot] gpio: zynq: Do not check unsigned type that is >= 0

Message ID 2cc65cd0791de33b4077399b463bdd096587d1bf.1528873628.git.michal.simek@xilinx.com
State Accepted
Delegated to: Michal Simek
Headers show
Series
  • [U-Boot] gpio: zynq: Do not check unsigned type that is >= 0
Related show

Commit Message

Michal Simek June 13, 2018, 7:07 a.m.
There is no reason to check that unsigned type that is >= 0.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

 drivers/gpio/zynq_gpio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/drivers/gpio/zynq_gpio.c b/drivers/gpio/zynq_gpio.c
index 4cb75a862780..804ddbd4983b 100644
--- a/drivers/gpio/zynq_gpio.c
+++ b/drivers/gpio/zynq_gpio.c
@@ -189,7 +189,7 @@  static int gpio_is_valid(unsigned gpio, struct udevice *dev)
 {
 	struct zynq_gpio_privdata *priv = dev_get_priv(dev);
 
-	return (gpio >= 0) && (gpio < priv->p_data->ngpio);
+	return gpio < priv->p_data->ngpio;
 }
 
 static int check_gpio(unsigned gpio, struct udevice *dev)