]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
qed: Replace memset with eth_zero_addr
authorShyam Saini <mayhs11saini@gmail.com>
Tue, 17 Jan 2017 02:05:04 +0000 (07:35 +0530)
committerChuck Anderson <chuck.anderson@oracle.com>
Mon, 6 Mar 2017 05:00:24 +0000 (21:00 -0800)
Orabug: 25477939

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 <mayhs11saini@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 0ee28e31553a6f2ed13223e565ae5a4d7a376942)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Conflicts:
drivers/net/ethernet/qlogic/qed/qed_sriov.c

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

index 10da9352f99c7757c0e8601bc519e8bbcf644da4..808b3285455a1eab16db48f43e95064c979f797f 100644 (file)
@@ -1818,7 +1818,7 @@ static int qed_fill_eth_dev_info(struct qed_dev *cdev,
        qed_fill_dev_info(cdev, &info->common);
 
        if (IS_VF(cdev))
-               memset(info->common.hw_mac, 0, ETH_ALEN);
+               eth_zero_addr(info->common.hw_mac);
 
        return 0;
 }
index 469e857f5dcde81cafb6bd6a2642900e0d012922..9f3fed23045cd91628327ef7b9491acbcd5a598f 100644 (file)
@@ -1223,7 +1223,8 @@ static void qed_iov_clean_vf(struct qed_hwfn *p_hwfn, u8 vfid)
                return;
 
        /* Clear the VF mac */
-       memset(vf_info->mac, 0, ETH_ALEN);
+       eth_zero_addr(vf_info->mac);
+
 }
 
 static void qed_iov_vf_cleanup(struct qed_hwfn *p_hwfn,
@@ -2563,8 +2564,7 @@ static int qed_iov_vf_update_mac_shadow(struct qed_hwfn *p_hwfn,
                for (i = 0; i < QED_ETH_VF_NUM_MAC_FILTERS; i++) {
                        if (ether_addr_equal(p_vf->shadow_config.macs[i],
                                             p_params->mac)) {
-                               memset(p_vf->shadow_config.macs[i], 0,
-                                      ETH_ALEN);
+                               eth_zero_addr(p_vf->shadow_config.macs[i]);
                                break;
                        }
                }
@@ -2577,7 +2577,7 @@ static int qed_iov_vf_update_mac_shadow(struct qed_hwfn *p_hwfn,
        } else if (p_params->opcode == QED_FILTER_REPLACE ||
                   p_params->opcode == QED_FILTER_FLUSH) {
                for (i = 0; i < QED_ETH_VF_NUM_MAC_FILTERS; i++)
-                       memset(p_vf->shadow_config.macs[i], 0, ETH_ALEN);
+                       eth_zero_addr(p_vf->shadow_config.macs[i]);
        }
 
        /* List the new MAC address */