* [PATCH] sfc: Replace memset with eth_zero_addr
@ 2016-01-19 23:27 Lucas Tanure
2016-01-20 9:44 ` Bert Kenward
2016-01-20 11:44 ` Sergei Shtylyov
0 siblings, 2 replies; 5+ messages in thread
From: Lucas Tanure @ 2016-01-19 23:27 UTC (permalink / raw)
To: Shradha Shah; +Cc: Solarflare linux maintainers, netdev, linux-kernel
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 <tanure@linux.com>
---
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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] sfc: Replace memset with eth_zero_addr
2016-01-19 23:27 [PATCH] sfc: Replace memset with eth_zero_addr Lucas Tanure
@ 2016-01-20 9:44 ` Bert Kenward
2016-01-20 10:25 ` David Miller
2016-01-20 11:44 ` Sergei Shtylyov
1 sibling, 1 reply; 5+ messages in thread
From: Bert Kenward @ 2016-01-20 9:44 UTC (permalink / raw)
To: Lucas Tanure, Shradha Shah
Cc: Solarflare linux maintainers, netdev, linux-kernel
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 <tanure@linux.com>
> ---
Acked-by: Bert Kenward <bkenward@solarflare.com>
... although net-next is still closed I think.
--
Bert Kenward <bkenward@solarflare.com>
Software Engineer, Solarflare
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] sfc: Replace memset with eth_zero_addr
2016-01-20 9:44 ` Bert Kenward
@ 2016-01-20 10:25 ` David Miller
0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2016-01-20 10:25 UTC (permalink / raw)
To: bkenward; +Cc: tanure, sshah, linux-net-drivers, netdev, linux-kernel
From: Bert Kenward <bkenward@solarflare.com>
Date: Wed, 20 Jan 2016 09:44:30 +0000
> 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 <tanure@linux.com>
>> ---
>
> Acked-by: Bert Kenward <bkenward@solarflare.com>
>
> ... although net-next is still closed I think.
Correct.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] sfc: Replace memset with eth_zero_addr
2016-01-19 23:27 [PATCH] sfc: Replace memset with eth_zero_addr Lucas Tanure
2016-01-20 9:44 ` Bert Kenward
@ 2016-01-20 11:44 ` Sergei Shtylyov
2016-01-20 11:49 ` Lucas Tanure
1 sibling, 1 reply; 5+ messages in thread
From: Sergei Shtylyov @ 2016-01-20 11:44 UTC (permalink / raw)
To: Lucas Tanure, Shradha Shah
Cc: Solarflare linux maintainers, netdev, linux-kernel
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. :-)
> Signed-off-by: Lucas Tanure <tanure@linux.com>
> ---
> 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
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] sfc: Replace memset with eth_zero_addr
2016-01-20 11:44 ` Sergei Shtylyov
@ 2016-01-20 11:49 ` Lucas Tanure
0 siblings, 0 replies; 5+ messages in thread
From: Lucas Tanure @ 2016-01-20 11:49 UTC (permalink / raw)
To: Sergei Shtylyov
Cc: Shradha Shah, Solarflare linux maintainers, netdev, linux-kernel
Hi,
On Wed, Jan 20, 2016 at 9:44 AM, Sergei Shtylyov
<sergei.shtylyov@cogentembedded.com> wrote:
> 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. :-)
I mean the vf->mac, a pointer to a six-byte array containing the
Ethernet address.
>
>> Signed-off-by: Lucas Tanure <tanure@linux.com>
>> ---
>> 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
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-01-20 11:49 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-19 23:27 [PATCH] sfc: Replace memset with eth_zero_addr Lucas Tanure
2016-01-20 9:44 ` Bert Kenward
2016-01-20 10:25 ` David Miller
2016-01-20 11:44 ` Sergei Shtylyov
2016-01-20 11:49 ` Lucas Tanure
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox