mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-11 07:34:31 +00:00
usb gadget ether: Fix warning in is_eth_addr_valid()
The gadget ethernet driver needs to keep copies of the MAC address (at both endpoints) as strings so it needs a custom function for validation of the MAC. It was not however performing a totally correct check and also was emitting a warning about a set but unused variable. The solution to both is that after checking the string contents we use the standard test for a valid MAC. Cc: Joe Hershberger <joe.hershberger@ni.com> Cc: Marek Vasut <marex@denx.de> Signed-off-by: Tom Rini <trini@ti.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
This commit is contained in:
parent
ac63f2a2ec
commit
57a87a25f7
1 changed files with 2 additions and 2 deletions
|
@ -1978,8 +1978,8 @@ static int is_eth_addr_valid(char *str)
|
|||
p = q;
|
||||
}
|
||||
|
||||
if (i == 6) /* it looks ok */
|
||||
return 1;
|
||||
/* Now check the contents. */
|
||||
return is_valid_ether_addr(ea);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue