sfc: Replace memset with eth_zero_addr
Subsystems (3)
PATCH 1/1 sfc: Replace memset with eth_zero_addr
Use eth_zero_addr to assign the zero address to the given address array instead of memset when second argument is address of zero.
--- drivers/net/ethernet/sfc/ef10_sriov.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/sfc/ef10_sriov.c +1 -1
@@ -527,7 +527,7 @@ int efx_ef10_sriov_set_vf_mac(struct efx_nic *efx, int vf_i, u8 *mac)return 0 ; fail: -memset (vf->mac,0 ,ETH_ALEN ); +eth_zero_addr (vf->mac);return rc; }
Signature · 1 line
2.7.0
Quoted 5 lines · Lucas Tanure
Use
eth_zero_addrto assign the zero address to the given address array instead of memset when second argument is address of zero.Signed-off-by Lucas Tanure <[email protected]>---
... although net-next is still closed I think.
Signature · 2 lines
Bert Kenward <[email protected]> Software Engineer, Solarflare
David Miller
maintainerFrom: Bert Kenward <[email protected]>
Date: Wed, 20 Jan 2016 09:44:30 +0000
Quoted 10 lines · Lucas Tanure
Quoted 5 lines
Use
eth_zero_addrto assign the zero address to the given address array instead of memset when second argument is address of zero.Signed-off-by Lucas Tanure <[email protected]>---
Acked-by Bert Kenward <[email protected]>... although net-next is still closed I think.
Correct.
Hello.
Quoted 2 lines · Lucas Tanure
Use
eth_zero_addrto assign the zero address to the given address array instead of memset when second argument is address of zero.
What address? memset() takes just 1 address. :-)
Quoted 10 lines
Signed-off-by Lucas Tanure <[email protected]>--- drivers/net/ethernet/sfc/ef10_sriov.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/ethernet/sfc/ef10_sriov.c +0
-0
drivers/net/ethernet/sfc/ef10_sriov.c int efx_ef10_sriov_set_vf_mac(struct efx_nic *efx, int vf_i, u8 *mac) · line 533
Quoted 8 lines
drivers/net/ethernet/sfc/ef10_sriov.c +1
-1@@ -527,7 +527,7 @@ int efx_ef10_sriov_set_vf_mac(struct efx_nic *efx, int vf_i, u8 *mac)return 0 ; fail: -memset (vf->mac,0 ,ETH_ALEN ); +eth_zero_addr (vf->mac);return rc; }
MBR, Sergei
Hi,
Quoted 9 lines · Sergei Shtylyov
Hello.
Quoted 2 lines · Lucas Tanure
Use
eth_zero_addrto assign the zero address to the given address array instead of memset when second argument is address of zero.What address?
memset()takes just 1 address. :-)
I mean the vf->mac, a pointer to a six-byte array containing the Ethernet address.
Quoted 15 lines
Quoted 15 lines
Signed-off-by Lucas Tanure <[email protected]>--- drivers/net/ethernet/sfc/ef10_sriov.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/ethernet/sfc/ef10_sriov.c +0
-0@@ -527,7 +527,7 @@ int efx_ef10_sriov_set_vf_mac(struct efx_nic *efx, int vf_i, u8 *mac)return 0 ;
Quoted 9 lines
drivers/net/ethernet/sfc/ef10_sriov.c int efx_ef10_sriov_set_vf_mac(struct efx_nic *efx, int vf_i, u8 *mac) · line 532
Quoted 6 lines
drivers/net/ethernet/sfc/ef10_sriov.c +1
-1fail: -memset (vf->mac,0 ,ETH_ALEN ); +eth_zero_addr (vf->mac);return rc; }MBR, Sergei
Thanks, Tanure