diff options
author | Joe Hershberger <joe.hershberger@ni.com> | 2015-03-22 17:09:01 -0500 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2015-04-18 11:11:10 -0600 |
commit | 4c7c65afbee22b3efddb3d813117c379de02ccad (patch) | |
tree | f2cb633b20111d1bca54e21c2392c2e0bab4267c | |
parent | 8b2c9a7157c3c737b3bdf640796509eef0a58c52 (diff) | |
download | u-boot-imx-4c7c65afbee22b3efddb3d813117c379de02ccad.zip u-boot-imx-4c7c65afbee22b3efddb3d813117c379de02ccad.tar.gz u-boot-imx-4c7c65afbee22b3efddb3d813117c379de02ccad.tar.bz2 |
net: Rename helper function to be more clear
Make it clear that the helper is checking the addr, not setting it.
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
-rw-r--r-- | net/eth.c | 13 |
1 files changed, 4 insertions, 9 deletions
@@ -153,11 +153,6 @@ static void eth_current_changed(void) setenv("ethact", NULL); } -static int eth_address_set(unsigned char *addr) -{ - return memcmp(addr, "\0\0\0\0\0\0", 6); -} - int eth_write_hwaddr(struct eth_device *dev, const char *base_name, int eth_number) { @@ -166,9 +161,9 @@ int eth_write_hwaddr(struct eth_device *dev, const char *base_name, eth_getenv_enetaddr_by_index(base_name, eth_number, env_enetaddr); - if (eth_address_set(env_enetaddr)) { - if (eth_address_set(dev->enetaddr) && - memcmp(dev->enetaddr, env_enetaddr, 6)) { + if (!is_zero_ether_addr(env_enetaddr)) { + if (!is_zero_ether_addr(dev->enetaddr) && + memcmp(dev->enetaddr, env_enetaddr, 6)) { printf("\nWarning: %s MAC addresses don't match:\n", dev->name); printf("Address in SROM is %pM\n", @@ -183,7 +178,7 @@ int eth_write_hwaddr(struct eth_device *dev, const char *base_name, dev->enetaddr); printf("\nWarning: %s using MAC address from net device\n", dev->name); - } else if (!(eth_address_set(dev->enetaddr))) { + } else if (is_zero_ether_addr(dev->enetaddr)) { printf("\nError: %s address not set.\n", dev->name); return -EINVAL; |