Skip to content
Snippets Groups Projects
Commit 75897910 authored by Tom Rini's avatar Tom Rini
Browse files

gpio-uclass.c: Fix comparison of unsigned expression warning


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 <sjg@chromium.org>
Signed-off-by: default avatarTom Rini <trini@konsulko.com>
Reviewed-by: default avatarSimon Glass <sjg@chromium.org>
parent 62f733b3
No related branches found
No related tags found
No related merge requests found
...@@ -68,7 +68,7 @@ int dm_gpio_lookup_name(const char *name, struct gpio_desc *desc) ...@@ -68,7 +68,7 @@ int dm_gpio_lookup_name(const char *name, struct gpio_desc *desc)
if (numeric != -1) { if (numeric != -1) {
offset = numeric - uc_priv->gpio_base; offset = numeric - uc_priv->gpio_base;
/* Allow GPIOs to be numbered from 0 */ /* Allow GPIOs to be numbered from 0 */
if (offset >= 0 && offset < uc_priv->gpio_count) if (offset < uc_priv->gpio_count)
break; break;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment