[<prev] [next>] [day] [month] [year] [list]
Message-ID: <1650533327-29396-1-git-send-email-baihaowen@meizu.com>
Date: Thu, 21 Apr 2022 17:28:47 +0800
From: Haowen Bai <baihaowen@...zu.com>
To: Anil Gurumurthy <anil.gurumurthy@...gic.com>,
Sudarsana Kalluru <sudarsana.kalluru@...gic.com>,
"James E.J. Bottomley" <jejb@...ux.ibm.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>
CC: Haowen Bai <baihaowen@...zu.com>, <linux-scsi@...r.kernel.org>,
<linux-kernel@...r.kernel.org>
Subject: [PATCH] scsi: bfa: Drop redundant memset
The region set by the call to memset is immediately overwritten by the
subsequent call to memcpy. So we drop redundant memset.
Signed-off-by: Haowen Bai <baihaowen@...zu.com>
---
drivers/scsi/bfa/bfa_ioc.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/scsi/bfa/bfa_ioc.c b/drivers/scsi/bfa/bfa_ioc.c
index 5740302d83ac..2227e46a4813 100644
--- a/drivers/scsi/bfa/bfa_ioc.c
+++ b/drivers/scsi/bfa/bfa_ioc.c
@@ -2748,7 +2748,6 @@ bfa_ioc_get_type(struct bfa_ioc_s *ioc)
void
bfa_ioc_get_adapter_serial_num(struct bfa_ioc_s *ioc, char *serial_num)
{
- memset((void *)serial_num, 0, BFA_ADAPTER_SERIAL_NUM_LEN);
memcpy((void *)serial_num,
(void *)ioc->attr->brcd_serialnum,
BFA_ADAPTER_SERIAL_NUM_LEN);
@@ -2757,7 +2756,6 @@ bfa_ioc_get_adapter_serial_num(struct bfa_ioc_s *ioc, char *serial_num)
void
bfa_ioc_get_adapter_fw_ver(struct bfa_ioc_s *ioc, char *fw_ver)
{
- memset((void *)fw_ver, 0, BFA_VERSION_LEN);
memcpy(fw_ver, ioc->attr->fw_version, BFA_VERSION_LEN);
}
--
2.7.4
Powered by blists - more mailing lists