From: Joe Hershberger Date: Wed, 20 May 2015 19:27:17 +0000 (-0500) Subject: env: Fix return values in env_attr_lookup() X-Git-Tag: v2015.07-rc2~123 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7a0ad2cce3e84fdfb1d0f5b14b9e293cb6e69d71;p=u-boot env: Fix return values in env_attr_lookup() This function returned numbers for error codes. Change them to error codes. Signed-off-by: Joe Hershberger Reviewed-by: Simon Glass --- diff --git a/common/env_attr.c b/common/env_attr.c index 64baca5a10..e791f44200 100644 --- a/common/env_attr.c +++ b/common/env_attr.c @@ -148,10 +148,10 @@ int env_attr_lookup(const char *attr_list, const char *name, char *attributes) if (!attributes) /* bad parameter */ - return -1; + return -EINVAL; if (!attr_list) /* list not found */ - return 1; + return -EINVAL; entry = reverse_strstr(attr_list, name, NULL); while (entry != NULL) { @@ -209,5 +209,5 @@ int env_attr_lookup(const char *attr_list, const char *name, char *attributes) } /* not found in list */ - return 2; + return -ENOENT; }