All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sfc: Replace memset with eth_zero_addr
@ 2017-01-16  3:56 Shyam Saini
  2017-01-16  9:35 ` Edward Cree
  0 siblings, 1 reply; 8+ messages in thread
From: Shyam Saini @ 2017-01-16  3:56 UTC (permalink / raw)
  To: ecree; +Cc: bkenward, netdev, linux-net-drivers, Shyam Saini

Use eth_zero_addr to assign zero address to the given address array
instead of memset when the second argument in memset is address
of zero which makes the code clearer and also add header
file linux/etherdevice.h

Signed-off-by: Shyam Saini <mayhs11saini@gmail.com>
---
 drivers/net/ethernet/sfc/ef10_sriov.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/sfc/ef10_sriov.c b/drivers/net/ethernet/sfc/ef10_sriov.c
index a949b9d..228806c 100644
--- a/drivers/net/ethernet/sfc/ef10_sriov.c
+++ b/drivers/net/ethernet/sfc/ef10_sriov.c
@@ -6,6 +6,7 @@
  * under the terms of the GNU General Public License version 2 as published
  * by the Free Software Foundation, incorporated herein by reference.
  */
+#include <linux/etherdevice.h>
 #include <linux/pci.h>
 #include <linux/module.h>
 #include "net_driver.h"
@@ -554,7 +555,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.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] sfc: Replace memset with eth_zero_addr
  2017-01-16  3:56 [PATCH] sfc: Replace memset with eth_zero_addr Shyam Saini
@ 2017-01-16  9:35 ` Edward Cree
  2017-01-16 16:47   ` David Miller
  0 siblings, 1 reply; 8+ messages in thread
From: Edward Cree @ 2017-01-16  9:35 UTC (permalink / raw)
  To: Shyam Saini; +Cc: bkenward, netdev, linux-net-drivers

On 16/01/17 03:56, Shyam Saini wrote:
> Use eth_zero_addr to assign zero address to the given address array
> instead of memset when the second argument in memset is address
> of zero which makes the code clearer and also add header
> file linux/etherdevice.h
>
> Signed-off-by: Shyam Saini <mayhs11saini@gmail.com>
> ---
Acked-by: Edward Cree <ecree@solarflare.com>
>  drivers/net/ethernet/sfc/ef10_sriov.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/sfc/ef10_sriov.c b/drivers/net/ethernet/sfc/ef10_sriov.c
> index a949b9d..228806c 100644
> --- a/drivers/net/ethernet/sfc/ef10_sriov.c
> +++ b/drivers/net/ethernet/sfc/ef10_sriov.c
> @@ -6,6 +6,7 @@
>   * under the terms of the GNU General Public License version 2 as published
>   * by the Free Software Foundation, incorporated herein by reference.
>   */
> +#include <linux/etherdevice.h>
>  #include <linux/pci.h>
>  #include <linux/module.h>
>  #include "net_driver.h"
> @@ -554,7 +555,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;
>  }
>  

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] sfc: Replace memset with eth_zero_addr
  2017-01-16  9:35 ` Edward Cree
@ 2017-01-16 16:47   ` David Miller
  0 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2017-01-16 16:47 UTC (permalink / raw)
  To: ecree; +Cc: mayhs11saini, bkenward, netdev, linux-net-drivers

From: Edward Cree <ecree@solarflare.com>
Date: Mon, 16 Jan 2017 09:35:38 +0000

> On 16/01/17 03:56, Shyam Saini wrote:
>> Use eth_zero_addr to assign zero address to the given address array
>> instead of memset when the second argument in memset is address
>> of zero which makes the code clearer and also add header
>> file linux/etherdevice.h
>>
>> Signed-off-by: Shyam Saini <mayhs11saini@gmail.com>
>> ---
> Acked-by: Edward Cree <ecree@solarflare.com>

Applied to net-next.

^ permalink raw reply	[flat|nested] 8+ 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; 8+ 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] 8+ messages in thread

* Re: [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
  2016-01-20 11:49   ` Lucas Tanure
  1 sibling, 1 reply; 8+ 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] 8+ 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; 8+ 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] 8+ messages in thread

* Re: [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 10:25   ` David Miller
  2016-01-20 11:44 ` Sergei Shtylyov
  1 sibling, 1 reply; 8+ 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] 8+ messages in thread

* [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; 8+ 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] 8+ messages in thread

end of thread, other threads:[~2017-01-16 16:47 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-16  3:56 [PATCH] sfc: Replace memset with eth_zero_addr Shyam Saini
2017-01-16  9:35 ` Edward Cree
2017-01-16 16:47   ` David Miller
  -- strict thread matches above, loose matches on Subject: below --
2016-01-19 23:27 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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.