[U-Boot] [PATCH 3/3] net: Be less picky about decoding the netretry env var

Simon Glass sjg at chromium.org
Thu Oct 27 02:18:40 CEST 2011


This is intended purely as a code size reduction.

Signed-off-by: Simon Glass <sjg at chromium.org>
---
 net/net.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/net.c b/net/net.c
index cd34bf9..3712e17 100644
--- a/net/net.c
+++ b/net/net.c
@@ -605,11 +605,11 @@ void NetStartAgain(void)
 
 	nretry = getenv("netretry");
 	if (nretry) {
-		if (!strcmp(nretry, "yes"))
+		if (*nretry == 'y')
 			retry_forever = 1;
-		else if (!strcmp(nretry, "no"))
+		else if (!*nretry == 'n')
 			retrycnt = 0;
-		else if (!strcmp(nretry, "once"))
+		else if (*nretry == 'o')	/* "once" */
 			retrycnt = 1;
 		else
 			retrycnt = simple_strtoul(nretry, NULL, 0);
-- 
1.7.3.1



More information about the U-Boot mailing list