summaryrefslogtreecommitdiff
path: root/net/eth.c
diff options
context:
space:
mode:
authorJoe Hershberger <joe.hershberger@ni.com>2015-04-08 01:41:19 -0500
committerSimon Glass <sjg@chromium.org>2015-04-18 11:11:35 -0600
commitff819a3a33de2152a52425e4108d41de5fc7fa64 (patch)
treebcb44c66d305cf9fd5889312d10d195d5615dd4e /net/eth.c
parent8e7ff6773a12473690b58208c73d4fe19eab6fba (diff)
downloadu-boot-imx-ff819a3a33de2152a52425e4108d41de5fc7fa64.zip
u-boot-imx-ff819a3a33de2152a52425e4108d41de5fc7fa64.tar.gz
u-boot-imx-ff819a3a33de2152a52425e4108d41de5fc7fa64.tar.bz2
net: cosmetic: Fix checkpatch.pl failures in eth.c
There were still a few failures in net/eth.c, especially in the legacy part of the code. Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Acked-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'net/eth.c')
-rw-r--r--net/eth.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/net/eth.c b/net/eth.c
index 3f5cb7e..da97095 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -74,8 +74,10 @@ static int eth_mac_skip(int index)
{
char enetvar[15];
char *skip_state;
+
sprintf(enetvar, index ? "eth%dmacskip" : "ethmacskip", index);
- return ((skip_state = getenv(enetvar)) != NULL);
+ skip_state = getenv(enetvar);
+ return skip_state != NULL;
}
static void eth_current_changed(void);
@@ -275,8 +277,9 @@ int eth_init(void)
priv->state = ETH_STATE_ACTIVE;
return 0;
}
- } else
+ } else {
ret = eth_errno;
+ }
debug("FAIL\n");
@@ -612,11 +615,11 @@ int eth_write_hwaddr(struct eth_device *dev, const char *base_name,
if (!is_zero_ethaddr(dev->enetaddr) &&
memcmp(dev->enetaddr, env_enetaddr, 6)) {
printf("\nWarning: %s MAC addresses don't match:\n",
- dev->name);
+ dev->name);
printf("Address in SROM is %pM\n",
- dev->enetaddr);
+ dev->enetaddr);
printf("Address in environment is %pM\n",
- env_enetaddr);
+ env_enetaddr);
}
memcpy(dev->enetaddr, env_enetaddr, 6);
@@ -624,7 +627,7 @@ int eth_write_hwaddr(struct eth_device *dev, const char *base_name,
eth_setenv_enetaddr_by_index(base_name, eth_number,
dev->enetaddr);
printf("\nWarning: %s using MAC address from net device\n",
- dev->name);
+ dev->name);
} else if (is_zero_ethaddr(dev->enetaddr)) {
printf("\nError: %s address not set.\n",
dev->name);
@@ -634,13 +637,14 @@ int eth_write_hwaddr(struct eth_device *dev, const char *base_name,
if (dev->write_hwaddr && !eth_mac_skip(eth_number)) {
if (!is_valid_ethaddr(dev->enetaddr)) {
printf("\nError: %s address %pM illegal value\n",
- dev->name, dev->enetaddr);
+ dev->name, dev->enetaddr);
return -EINVAL;
}
ret = dev->write_hwaddr(dev);
if (ret)
- printf("\nWarning: %s failed to set MAC address\n", dev->name);
+ printf("\nWarning: %s failed to set MAC address\n",
+ dev->name);
}
return ret;
@@ -654,7 +658,8 @@ int eth_register(struct eth_device *dev)
assert(strlen(dev->name) < sizeof(dev->name));
if (!eth_devices) {
- eth_current = eth_devices = dev;
+ eth_devices = dev;
+ eth_current = dev;
eth_current_changed();
} else {
for (d = eth_devices; d->next != eth_devices; d = d->next)
@@ -725,8 +730,9 @@ int eth_initialize(void)
} else if (cpu_eth_init != __def_eth_init) {
if (cpu_eth_init(gd->bd) < 0)
printf("CPU Net Initialization Failed\n");
- } else
+ } else {
printf("Net Initialization Skipped\n");
+ }
if (!eth_devices) {
puts("No ethernet found.\n");