diff options
author | Mike Frysinger <vapier@gentoo.org> | 2007-04-23 13:54:24 +0200 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2007-05-05 21:27:38 +0200 |
commit | ebd0a0ae05a44769c4e27458ad4e9f3438250443 (patch) | |
tree | 6a7373bfb126c9cacc94effab6723265f0fd3ce8 /drivers | |
parent | 2f15278c2eb911c668b4fe562130b78cf554d139 (diff) | |
download | u-boot-imx-ebd0a0ae05a44769c4e27458ad4e9f3438250443.zip u-boot-imx-ebd0a0ae05a44769c4e27458ad4e9f3438250443.tar.gz u-boot-imx-ebd0a0ae05a44769c4e27458ad4e9f3438250443.tar.bz2 |
[patch] use unsigned char in smc91111 driver for mac
the v_mac variable in the smc91111 driver is declared as a signed char ...
this causes problems when one of the bytes in the MAC is "signed" like 0xE0
because when it gets printed out, you get a display like:
0xFFFFFFE0 and that's no good
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/smc91111.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/smc91111.c b/drivers/smc91111.c index f91e4b9..8061f12 100644 --- a/drivers/smc91111.c +++ b/drivers/smc91111.c @@ -1538,9 +1538,9 @@ int eth_send(volatile void *packet, int length) { int smc_get_ethaddr (bd_t * bd) { int env_size, rom_valid, env_present = 0, reg; - char *s = NULL, *e, *v_mac, es[] = "11:22:33:44:55:66"; + char *s = NULL, *e, es[] = "11:22:33:44:55:66"; char s_env_mac[64]; - uchar v_env_mac[6], v_rom_mac[6]; + uchar v_env_mac[6], v_rom_mac[6], *v_mac; env_size = getenv_r ("ethaddr", s_env_mac, sizeof (s_env_mac)); if ((env_size > 0) && (env_size < sizeof (es))) { /* exit if env is bad */ @@ -1563,7 +1563,7 @@ int smc_get_ethaddr (bd_t * bd) if (!env_present) { /* if NO env */ if (rom_valid) { /* but ROM is valid */ - v_mac = (char *)v_rom_mac; + v_mac = v_rom_mac; sprintf (s_env_mac, "%02X:%02X:%02X:%02X:%02X:%02X", v_mac[0], v_mac[1], v_mac[2], v_mac[3], v_mac[4], v_mac[5]); @@ -1573,7 +1573,7 @@ int smc_get_ethaddr (bd_t * bd) return (-1); } } else { /* good env, don't care ROM */ - v_mac = (char *)v_env_mac; /* always use a good env over a ROM */ + v_mac = v_env_mac; /* always use a good env over a ROM */ } if (env_present && rom_valid) { /* if both env and ROM are good */ |