mirror of
https://github.com/smaeul/u-boot.git
synced 2025-10-14 04:46:01 +01:00
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>
This commit is contained in:
parent
8e7ff6773a
commit
ff819a3a33
16
net/eth.c
16
net/eth.c
@ -74,8 +74,10 @@ static int eth_mac_skip(int index)
|
|||||||
{
|
{
|
||||||
char enetvar[15];
|
char enetvar[15];
|
||||||
char *skip_state;
|
char *skip_state;
|
||||||
|
|
||||||
sprintf(enetvar, index ? "eth%dmacskip" : "ethmacskip", index);
|
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);
|
static void eth_current_changed(void);
|
||||||
@ -275,8 +277,9 @@ int eth_init(void)
|
|||||||
priv->state = ETH_STATE_ACTIVE;
|
priv->state = ETH_STATE_ACTIVE;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
} else
|
} else {
|
||||||
ret = eth_errno;
|
ret = eth_errno;
|
||||||
|
}
|
||||||
|
|
||||||
debug("FAIL\n");
|
debug("FAIL\n");
|
||||||
|
|
||||||
@ -640,7 +643,8 @@ int eth_write_hwaddr(struct eth_device *dev, const char *base_name,
|
|||||||
|
|
||||||
ret = dev->write_hwaddr(dev);
|
ret = dev->write_hwaddr(dev);
|
||||||
if (ret)
|
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;
|
return ret;
|
||||||
@ -654,7 +658,8 @@ int eth_register(struct eth_device *dev)
|
|||||||
assert(strlen(dev->name) < sizeof(dev->name));
|
assert(strlen(dev->name) < sizeof(dev->name));
|
||||||
|
|
||||||
if (!eth_devices) {
|
if (!eth_devices) {
|
||||||
eth_current = eth_devices = dev;
|
eth_devices = dev;
|
||||||
|
eth_current = dev;
|
||||||
eth_current_changed();
|
eth_current_changed();
|
||||||
} else {
|
} else {
|
||||||
for (d = eth_devices; d->next != eth_devices; d = d->next)
|
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) {
|
} else if (cpu_eth_init != __def_eth_init) {
|
||||||
if (cpu_eth_init(gd->bd) < 0)
|
if (cpu_eth_init(gd->bd) < 0)
|
||||||
printf("CPU Net Initialization Failed\n");
|
printf("CPU Net Initialization Failed\n");
|
||||||
} else
|
} else {
|
||||||
printf("Net Initialization Skipped\n");
|
printf("Net Initialization Skipped\n");
|
||||||
|
}
|
||||||
|
|
||||||
if (!eth_devices) {
|
if (!eth_devices) {
|
||||||
puts("No ethernet found.\n");
|
puts("No ethernet found.\n");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user