[PATCH] sfc: Replace memset with eth_zero_addr

Subsystems: networking drivers, sfc network driver, the rest

STALE3862d

5 messages, 4 authors, 2016-01-20 · open the first message on its own page

[PATCH] sfc: Replace memset with eth_zero_addr

From: Lucas Tanure <hidden>
Date: 2016-01-19 23:28:04

Use eth_zero_addr to assign the zero address to the given address array
instead of memset when second argument is address of zero.

Signed-off-by: Lucas Tanure <redacted>
---
 drivers/net/ethernet/sfc/ef10_sriov.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/sfc/ef10_sriov.c b/drivers/net/ethernet/sfc/ef10_sriov.c
index 3c17f27..10f60db 100644
--- a/drivers/net/ethernet/sfc/ef10_sriov.c
+++ b/drivers/net/ethernet/sfc/ef10_sriov.c
@@ -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;
 }
 
-- 
2.7.0

Re: [PATCH] sfc: Replace memset with eth_zero_addr

From: Bert Kenward <hidden>
Date: 2016-01-20 09:52:31

On 19/01/16 23:27, Lucas Tanure wrote:
Use eth_zero_addr to assign the zero address to the given address array
instead of memset when second argument is address of zero.

Signed-off-by: Lucas Tanure <redacted>
---
Acked-by: Bert Kenward <redacted>

... although net-next is still closed I think.

-- 
Bert Kenward [off-list ref]
Software Engineer, Solarflare

Re: [PATCH] sfc: Replace memset with eth_zero_addr

From: David Miller <davem@davemloft.net>
Date: 2016-01-20 10:25:52

From: Bert Kenward <redacted>
Date: Wed, 20 Jan 2016 09:44:30 +0000
On 19/01/16 23:27, Lucas Tanure wrote:
quoted
Use eth_zero_addr to assign the zero address to the given address array
instead of memset when second argument is address of zero.

Signed-off-by: Lucas Tanure <redacted>
---
Acked-by: Bert Kenward <redacted>

... although net-next is still closed I think.
Correct.

Re: [PATCH] sfc: Replace memset with eth_zero_addr

From: Sergei Shtylyov <hidden>
Date: 2016-01-20 11:44:13

Hello.

On 1/20/2016 2:27 AM, Lucas Tanure wrote:
Use eth_zero_addr to 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 hunk
Signed-off-by: Lucas Tanure <redacted>
---
  drivers/net/ethernet/sfc/ef10_sriov.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/sfc/ef10_sriov.c b/drivers/net/ethernet/sfc/ef10_sriov.c
index 3c17f27..10f60db 100644
--- a/drivers/net/ethernet/sfc/ef10_sriov.c
+++ b/drivers/net/ethernet/sfc/ef10_sriov.c
@@ -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

Re: [PATCH] sfc: Replace memset with eth_zero_addr

From: Lucas Tanure <hidden>
Date: 2016-01-20 11:49:06

Hi,

On Wed, Jan 20, 2016 at 9:44 AM, Sergei Shtylyov
[off-list ref] wrote:
Hello.

On 1/20/2016 2:27 AM, Lucas Tanure wrote:
quoted
Use eth_zero_addr to 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
Signed-off-by: Lucas Tanure <redacted>
---
  drivers/net/ethernet/sfc/ef10_sriov.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/sfc/ef10_sriov.c
b/drivers/net/ethernet/sfc/ef10_sriov.c
index 3c17f27..10f60db 100644
--- a/drivers/net/ethernet/sfc/ef10_sriov.c
+++ b/drivers/net/ethernet/sfc/ef10_sriov.c
@@ -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
Thanks, Tanure
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help