net: chelsio: cxgb4: use eth_zero_addr() to assign zero address
authorYang Yingliang <yangyingliang@huawei.com>
Wed, 16 Jun 2021 06:43:18 +0000 (14:43 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 16 Jun 2021 07:53:17 +0000 (00:53 -0700)
Using eth_zero_addr() to assign zero address insetad of
inefficient copy from an array.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c

index ae3ad99fbd068c899ad46c94707c03f062dcbd9b..9e3ea5f7be2e403dc38152ace160c11dd29fda48 100644 (file)
@@ -7782,7 +7782,6 @@ int t4_free_encap_mac_filt(struct adapter *adap, unsigned int viid,
                           int idx, bool sleep_ok)
 {
        struct fw_vi_mac_exact *p;
-       u8 addr[] = {0, 0, 0, 0, 0, 0};
        struct fw_vi_mac_cmd c;
        int ret = 0;
        u32 exact;
@@ -7799,7 +7798,7 @@ int t4_free_encap_mac_filt(struct adapter *adap, unsigned int viid,
        p = c.u.exact;
        p->valid_to_idx = cpu_to_be16(FW_VI_MAC_CMD_VALID_F |
                                      FW_VI_MAC_CMD_IDX_V(idx));
-       memcpy(p->macaddr, addr, sizeof(p->macaddr));
+       eth_zero_addr(p->macaddr);
        ret = t4_wr_mbox_meat(adap, adap->mbox, &c, sizeof(c), &c, sleep_ok);
        return ret;
 }