usb gadget ether: Fix warning in is_eth_addr_valid()
PATCH 1/1 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.
--- drivers/usb/gadget/ether.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/gadget/ether.c +2 -2
@@ -1968,8 +1968,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 ; }
Signature · 1 line
1.7.9.5
PATCH 1/1 usb gadget ether: Fix warning in is_eth_addr_valid()
Hi Tom,
Quoted 11 lines · Tom Rini
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 <[email protected]>Cc Marek Vasut <[email protected]>Signed-off-by Tom Rini <[email protected]>---
PATCH 1/1 usb gadget ether: Fix warning in is_eth_addr_valid()
Quoted 10 lines · Joe Hershberger
Hi Tom,
Quoted 7 lines · Tom Rini
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.
Quoted 6 lines
Quoted 4 lines
Cc Joe Hershberger <[email protected]>Cc Marek Vasut <[email protected]>Signed-off-by Tom Rini <[email protected]>---
Acked-by Joe Hershberger <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20121104/c138ec11/attachment.pgp>