浏览代码

sfc: Replace memset with eth_zero_addr

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>
Signed-off-by: David S. Miller <davem@davemloft.net>
Shyam Saini 8 年之前
父节点
当前提交
4b5b1ac5c0
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      drivers/net/ethernet/sfc/ef10_sriov.c

+ 2 - 1
drivers/net/ethernet/sfc/ef10_sriov.c

@@ -6,6 +6,7 @@
  * under the terms of the GNU General Public License version 2 as published
  * under the terms of the GNU General Public License version 2 as published
  * by the Free Software Foundation, incorporated herein by reference.
  * by the Free Software Foundation, incorporated herein by reference.
  */
  */
+#include <linux/etherdevice.h>
 #include <linux/pci.h>
 #include <linux/pci.h>
 #include <linux/module.h>
 #include <linux/module.h>
 #include "net_driver.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;
 	return 0;
 
 
 fail:
 fail:
-	memset(vf->mac, 0, ETH_ALEN);
+	eth_zero_addr(vf->mac);
 	return rc;
 	return rc;
 }
 }