Commit b29e9138 authored by Xiu Jianfeng's avatar Xiu Jianfeng Committed by Martin K. Petersen

scsi: lpfc: Use memset_startat() helper

Use memset_startat() helper to simplify the code, no functional changes in
this patch.
Signed-off-by: default avatarXiu Jianfeng <xiujianfeng@huawei.com>
Link: https://lore.kernel.org/r/20221111074310.132125-1-xiujianfeng@huawei.comReviewed-by: default avatarJames Smart <jsmart2021@gmail.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 216e1797
...@@ -1373,7 +1373,6 @@ static void ...@@ -1373,7 +1373,6 @@ static void
__lpfc_sli_release_iocbq_s4(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq) __lpfc_sli_release_iocbq_s4(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq)
{ {
struct lpfc_sglq *sglq; struct lpfc_sglq *sglq;
size_t start_clean = offsetof(struct lpfc_iocbq, wqe);
unsigned long iflag = 0; unsigned long iflag = 0;
struct lpfc_sli_ring *pring; struct lpfc_sli_ring *pring;
...@@ -1430,7 +1429,7 @@ __lpfc_sli_release_iocbq_s4(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq) ...@@ -1430,7 +1429,7 @@ __lpfc_sli_release_iocbq_s4(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq)
/* /*
* Clean all volatile data fields, preserve iotag and node struct. * Clean all volatile data fields, preserve iotag and node struct.
*/ */
memset((char *)iocbq + start_clean, 0, sizeof(*iocbq) - start_clean); memset_startat(iocbq, 0, wqe);
iocbq->sli4_lxritag = NO_XRI; iocbq->sli4_lxritag = NO_XRI;
iocbq->sli4_xritag = NO_XRI; iocbq->sli4_xritag = NO_XRI;
iocbq->cmd_flag &= ~(LPFC_IO_NVME | LPFC_IO_NVMET | LPFC_IO_CMF | iocbq->cmd_flag &= ~(LPFC_IO_NVME | LPFC_IO_NVMET | LPFC_IO_CMF |
...@@ -1453,12 +1452,11 @@ __lpfc_sli_release_iocbq_s4(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq) ...@@ -1453,12 +1452,11 @@ __lpfc_sli_release_iocbq_s4(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq)
static void static void
__lpfc_sli_release_iocbq_s3(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq) __lpfc_sli_release_iocbq_s3(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq)
{ {
size_t start_clean = offsetof(struct lpfc_iocbq, iocb);
/* /*
* Clean all volatile data fields, preserve iotag and node struct. * Clean all volatile data fields, preserve iotag and node struct.
*/ */
memset((char*)iocbq + start_clean, 0, sizeof(*iocbq) - start_clean); memset_startat(iocbq, 0, iocb);
iocbq->sli4_xritag = NO_XRI; iocbq->sli4_xritag = NO_XRI;
list_add_tail(&iocbq->list, &phba->lpfc_iocb_list); list_add_tail(&iocbq->list, &phba->lpfc_iocb_list);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment