From 50a47d0523e8efebe912bef539a77ffd42116451 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Wed, 4 Apr 2012 18:53:40 +0000 Subject: net: punt bd->bi_ip_addr This field gets read in one place (by "bdinfo"), and we can replace that with getenv("ipaddr"). After all, the bi_ip_addr field is kept up-to-date implicitly with the value of the ipaddr env var. Signed-off-by: Mike Frysinger Reviewed-by: Joe Hershberger --- common/cmd_nvedit.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'common/cmd_nvedit.c') diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c index e1ccdd8f7e2..5999cb80e36 100644 --- a/common/cmd_nvedit.c +++ b/common/cmd_nvedit.c @@ -343,21 +343,7 @@ int _do_env_set(int flag, int argc, char * const argv[]) * Some variables should be updated when the corresponding * entry in the environment is changed */ - if (strcmp(name, "ipaddr") == 0) { - char *s = argv[2]; /* always use only one arg */ - char *e; - unsigned long addr; - bd->bi_ip_addr = 0; - for (addr = 0, i = 0; i < 4; ++i) { - ulong val = s ? simple_strtoul(s, &e, 10) : 0; - addr <<= 8; - addr |= val & 0xFF; - if (s) - s = *e ? e + 1 : e; - } - bd->bi_ip_addr = htonl(addr); - return 0; - } else if (strcmp(argv[1], "loadaddr") == 0) { + if (strcmp(argv[1], "loadaddr") == 0) { load_addr = simple_strtoul(argv[2], NULL, 16); return 0; } -- cgit v1.2.3