Skip to content

Commit 0ee28e3

Browse files
mystictotdavem330
authored andcommitted
qed: 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. Also, it makes the code clearer Signed-off-by: Shyam Saini <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 53631a5 commit 0ee28e3

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

drivers/net/ethernet/qlogic/qed/qed_l2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1846,7 +1846,7 @@ static int qed_fill_eth_dev_info(struct qed_dev *cdev,
18461846
qed_fill_dev_info(cdev, &info->common);
18471847

18481848
if (IS_VF(cdev))
1849-
memset(info->common.hw_mac, 0, ETH_ALEN);
1849+
eth_zero_addr(info->common.hw_mac);
18501850

18511851
return 0;
18521852
}

drivers/net/ethernet/qlogic/qed/qed_sriov.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1224,7 +1224,7 @@ static void qed_iov_clean_vf(struct qed_hwfn *p_hwfn, u8 vfid)
12241224
return;
12251225

12261226
/* Clear the VF mac */
1227-
memset(vf_info->mac, 0, ETH_ALEN);
1227+
eth_zero_addr(vf_info->mac);
12281228

12291229
vf_info->rx_accept_mode = 0;
12301230
vf_info->tx_accept_mode = 0;
@@ -2626,8 +2626,7 @@ static int qed_iov_vf_update_mac_shadow(struct qed_hwfn *p_hwfn,
26262626
for (i = 0; i < QED_ETH_VF_NUM_MAC_FILTERS; i++) {
26272627
if (ether_addr_equal(p_vf->shadow_config.macs[i],
26282628
p_params->mac)) {
2629-
memset(p_vf->shadow_config.macs[i], 0,
2630-
ETH_ALEN);
2629+
eth_zero_addr(p_vf->shadow_config.macs[i]);
26312630
break;
26322631
}
26332632
}
@@ -2640,7 +2639,7 @@ static int qed_iov_vf_update_mac_shadow(struct qed_hwfn *p_hwfn,
26402639
} else if (p_params->opcode == QED_FILTER_REPLACE ||
26412640
p_params->opcode == QED_FILTER_FLUSH) {
26422641
for (i = 0; i < QED_ETH_VF_NUM_MAC_FILTERS; i++)
2643-
memset(p_vf->shadow_config.macs[i], 0, ETH_ALEN);
2642+
eth_zero_addr(p_vf->shadow_config.macs[i]);
26442643
}
26452644

26462645
/* List the new MAC address */

0 commit comments

Comments
 (0)