[U-Boot] [PATCH] [PATCH] net/eth.c: Avoid Warning when ethxaddr is not set

Gwenhael Goavec-Merou gwenhael.goavec-merou at armadeus.com
Sat Mar 3 14:10:11 CET 2012


The return value for eth_getenv_enetaddr_by_index produces 
a Warning when ethXaddr is not set (env_enetaddr is equal 
to 00:00:00:00:00:00).

The validity of the mac address is tested later in this 
function to avoid to write an erroneous address.

The test of the function's return is consequently useless 
and adds a warning.

Signed-off-by: Gwenhael Goavec-Merou <gwenhael.goavec-merou at armadeus.com>
---
 net/eth.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/net/eth.c b/net/eth.c
index b4b9b43..1e61aed 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -175,8 +175,7 @@ int eth_write_hwaddr(struct eth_device *dev, const char *base_name,
 	unsigned char env_enetaddr[6];
 	int ret = 0;
 
-	if (!eth_getenv_enetaddr_by_index(base_name, eth_number, env_enetaddr))
-		return -1;
+	(void)eth_getenv_enetaddr_by_index(base_name, eth_number, env_enetaddr);
 
 	if (memcmp(env_enetaddr, "\0\0\0\0\0\0", 6)) {
 		if (memcmp(dev->enetaddr, "\0\0\0\0\0\0", 6) &&
-- 
1.7.3.4



More information about the U-Boot mailing list