All of lore.kernel.org
 help / color / mirror / Atom feed
* [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
* [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

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 --
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
2017-01-16  3:56 Shyam Saini
2017-01-16  9:35 ` Edward Cree
2017-01-16 16:47   ` David Miller

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.