diff options
| author | Mike Frysinger <vapier@gentoo.org> | 2012-04-04 18:53:40 +0000 | 
|---|---|---|
| committer | Joe Hershberger <joe.hershberger@ni.com> | 2012-05-15 17:32:05 -0500 | 
| commit | 50a47d0523e8efebe912bef539a77ffd42116451 (patch) | |
| tree | 4501fa8c08405a3d9595a252df1ce725e27f3a0b /common/cmd_nvedit.c | |
| parent | e1902ac698194fdf20b473bd2d9c592c45554b72 (diff) | |
| download | olio-uboot-2014.01-50a47d0523e8efebe912bef539a77ffd42116451.tar.xz olio-uboot-2014.01-50a47d0523e8efebe912bef539a77ffd42116451.zip | |
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 <vapier@gentoo.org>
Reviewed-by: Joe Hershberger <joe.hershberger@ni.com>
Diffstat (limited to 'common/cmd_nvedit.c')
| -rw-r--r-- | common/cmd_nvedit.c | 16 | 
1 files changed, 1 insertions, 15 deletions
| diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c index e1ccdd8f7..5999cb80e 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;  	} |