mirror of
https://github.com/Stichting-MINIX-Research-Foundation/u-boot.git
synced 2025-09-10 04:26:19 -04:00
net: cosmetic: eth.c checkpatch compliance
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com> Acked-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
3090b7e36c
commit
66c7385a5f
31
net/eth.c
31
net/eth.c
@ -87,7 +87,7 @@ static struct {
|
||||
int length;
|
||||
} eth_rcv_bufs[PKTBUFSRX];
|
||||
|
||||
static unsigned int eth_rcv_current = 0, eth_rcv_last = 0;
|
||||
static unsigned int eth_rcv_current, eth_rcv_last;
|
||||
#endif
|
||||
|
||||
static struct eth_device *eth_devices, *eth_current;
|
||||
@ -141,9 +141,8 @@ struct eth_device *eth_get_dev_by_index(int index)
|
||||
|
||||
int eth_get_dev_index(void)
|
||||
{
|
||||
if (!eth_current) {
|
||||
if (!eth_current)
|
||||
return -1;
|
||||
}
|
||||
|
||||
return eth_current->index;
|
||||
}
|
||||
@ -188,9 +187,8 @@ int eth_write_hwaddr(struct eth_device *dev, const char *base_name,
|
||||
|
||||
if (dev->write_hwaddr &&
|
||||
!eth_mac_skip(eth_number) &&
|
||||
is_valid_ether_addr(dev->enetaddr)) {
|
||||
is_valid_ether_addr(dev->enetaddr))
|
||||
ret = dev->write_hwaddr(dev);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
@ -198,7 +196,7 @@ int eth_write_hwaddr(struct eth_device *dev, const char *base_name,
|
||||
int eth_register(struct eth_device *dev)
|
||||
{
|
||||
struct eth_device *d;
|
||||
static int index = 0;
|
||||
static int index;
|
||||
|
||||
assert(strlen(dev->name) < sizeof(dev->name));
|
||||
|
||||
@ -295,7 +293,8 @@ int eth_initialize(bd_t *bis)
|
||||
}
|
||||
|
||||
if (strchr(dev->name, ' '))
|
||||
puts("\nWarning: eth device name has a space!\n");
|
||||
puts("\nWarning: eth device name has a space!"
|
||||
"\n");
|
||||
|
||||
if (eth_write_hwaddr(dev, "eth", dev->index))
|
||||
puts("\nWarning: failed to set MAC address\n");
|
||||
@ -470,37 +469,35 @@ int eth_receive(void *packet, int length)
|
||||
|
||||
void eth_try_another(int first_restart)
|
||||
{
|
||||
static struct eth_device *first_failed = NULL;
|
||||
static struct eth_device *first_failed;
|
||||
char *ethrotate;
|
||||
|
||||
/*
|
||||
* Do not rotate between network interfaces when
|
||||
* 'ethrotate' variable is set to 'no'.
|
||||
*/
|
||||
if (((ethrotate = getenv ("ethrotate")) != NULL) &&
|
||||
(strcmp(ethrotate, "no") == 0))
|
||||
ethrotate = getenv("ethrotate");
|
||||
if ((ethrotate != NULL) && (strcmp(ethrotate, "no") == 0))
|
||||
return;
|
||||
|
||||
if (!eth_current)
|
||||
return;
|
||||
|
||||
if (first_restart) {
|
||||
if (first_restart)
|
||||
first_failed = eth_current;
|
||||
}
|
||||
|
||||
eth_current = eth_current->next;
|
||||
|
||||
eth_current_changed();
|
||||
|
||||
if (first_failed == eth_current) {
|
||||
if (first_failed == eth_current)
|
||||
NetRestartWrap = 1;
|
||||
}
|
||||
}
|
||||
|
||||
void eth_set_current(void)
|
||||
{
|
||||
static char *act = NULL;
|
||||
static int env_changed_id = 0;
|
||||
static char *act;
|
||||
static int env_changed_id;
|
||||
struct eth_device *old_current;
|
||||
int env_id;
|
||||
|
||||
@ -526,5 +523,5 @@ void eth_set_current(void)
|
||||
|
||||
char *eth_get_name(void)
|
||||
{
|
||||
return (eth_current ? eth_current->name : "unknown");
|
||||
return eth_current ? eth_current->name : "unknown";
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user