scsi: fnic: Replace memset() with eth_zero_addr()
authorChen Ni <nichen@iscas.ac.cn>
Mon, 19 May 2025 08:54:57 +0000 (16:54 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 21 May 2025 01:28:14 +0000 (21:28 -0400)
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: Chen Ni <nichen@iscas.ac.cn>
Link: https://lore.kernel.org/r/20250519085457.918720-1-nichen@iscas.ac.cn
Reviewed-by: Karan Tilak Kumar <kartilak@cisco.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/fnic/fip.c

index 6e7c0b00eb414d8148e102ad2908dcf59f662eef..19395e2aee44d0710e5fd0c3e3bbd23071f9202b 100644 (file)
@@ -200,7 +200,7 @@ void fnic_fcoe_start_fcf_discovery(struct fnic *fnic)
                return;
        }
 
-       memset(iport->selected_fcf.fcf_mac, 0, ETH_ALEN);
+       eth_zero_addr(iport->selected_fcf.fcf_mac);
 
        pdisc_sol = (struct fip_discovery *) frame;
        *pdisc_sol = (struct fip_discovery) {
@@ -588,12 +588,12 @@ void fnic_common_fip_cleanup(struct fnic *fnic)
        if (!is_zero_ether_addr(iport->fpma))
                vnic_dev_del_addr(fnic->vdev, iport->fpma);
 
-       memset(iport->fpma, 0, ETH_ALEN);
+       eth_zero_addr(iport->fpma);
        iport->fcid = 0;
        iport->r_a_tov = 0;
        iport->e_d_tov = 0;
-       memset(fnic->iport.fcfmac, 0, ETH_ALEN);
-       memset(iport->selected_fcf.fcf_mac, 0, ETH_ALEN);
+       eth_zero_addr(fnic->iport.fcfmac);
+       eth_zero_addr(iport->selected_fcf.fcf_mac);
        iport->selected_fcf.fcf_priority = 0;
        iport->selected_fcf.fka_adv_period = 0;
        iport->selected_fcf.ka_disabled = 0;