From: Tom Rini Date: Wed, 10 May 2017 15:20:15 -0400 Subject: [U-Boot] [PATCH 5/8] gpio-uclass.c: Fix comparison of unsigned expression warning In-Reply-To: <1494444018-2748-1-git-send-email-trini@konsulko.com> References: <1494444018-2748-1-git-send-email-trini@konsulko.com> Message-ID: <1494444018-2748-5-git-send-email-trini@konsulko.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de We declare that gpio_base (which is the base for counting gpios, not an address) is unsigned. Therefore the comparison with >= 0 is always true. As the desire is to allow for this base number to be 0, we can just drop this check. Reported by clang-3.8. Cc: Simon Glass Signed-off-by: Tom Rini --- drivers/gpio/gpio-uclass.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-uclass.c b/drivers/gpio/gpio-uclass.c index 9ab9df4ce7a6..ba4804083daa 100644 --- a/drivers/gpio/gpio-uclass.c +++ b/drivers/gpio/gpio-uclass.c @@ -68,7 +68,7 @@ int dm_gpio_lookup_name(const char *name, struct gpio_desc *desc) if (numeric != -1) { offset = numeric - uc_priv->gpio_base; /* Allow GPIOs to be numbered from 0 */ - if (offset >= 0 && offset < uc_priv->gpio_count) + if (offset < uc_priv->gpio_count) break; } -- 1.9.1