linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] scsi: lpfc: Use memset_startat() helper
@ 2022-11-11  7:43 Xiu Jianfeng
  2022-11-12 16:50 ` James Smart
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Xiu Jianfeng @ 2022-11-11  7:43 UTC (permalink / raw)
  To: james.smart, dick.kennedy, jejb, martin.petersen; +Cc: linux-scsi, linux-kernel

User memset_startat() helper to simplify the code, no functional
changes in this patch.

Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>
---
 drivers/scsi/lpfc/lpfc_sli.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index d25afc9dde14..35c9404d5e49 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -1373,7 +1373,6 @@ static void
 __lpfc_sli_release_iocbq_s4(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq)
 {
 	struct lpfc_sglq *sglq;
-	size_t start_clean = offsetof(struct lpfc_iocbq, wqe);
 	unsigned long iflag = 0;
 	struct lpfc_sli_ring *pring;
 
@@ -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.
 	 */
-	memset((char *)iocbq + start_clean, 0, sizeof(*iocbq) - start_clean);
+	memset_startat(iocbq, 0, wqe);
 	iocbq->sli4_lxritag = NO_XRI;
 	iocbq->sli4_xritag = NO_XRI;
 	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)
 static void
 __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.
 	 */
-	memset((char*)iocbq + start_clean, 0, sizeof(*iocbq) - start_clean);
+	memset_startat(iocbq, 0, iocb);
 	iocbq->sli4_xritag = NO_XRI;
 	list_add_tail(&iocbq->list, &phba->lpfc_iocb_list);
 }
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH -next] scsi: lpfc: Use memset_startat() helper
  2022-11-11  7:43 [PATCH -next] scsi: lpfc: Use memset_startat() helper Xiu Jianfeng
@ 2022-11-12 16:50 ` James Smart
  2022-11-17 18:13 ` Martin K. Petersen
  2022-11-26  3:27 ` Martin K. Petersen
  2 siblings, 0 replies; 4+ messages in thread
From: James Smart @ 2022-11-12 16:50 UTC (permalink / raw)
  To: Xiu Jianfeng, james.smart, dick.kennedy, jejb, martin.petersen
  Cc: linux-scsi, linux-kernel

On 11/10/2022 11:43 PM, Xiu Jianfeng wrote:
> User memset_startat() helper to simplify the code, no functional
> changes in this patch.
> 
> Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>

Looks good

Reviewed-by: James Smart <jsmart2021@gmail.com>

-- james


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH -next] scsi: lpfc: Use memset_startat() helper
  2022-11-11  7:43 [PATCH -next] scsi: lpfc: Use memset_startat() helper Xiu Jianfeng
  2022-11-12 16:50 ` James Smart
@ 2022-11-17 18:13 ` Martin K. Petersen
  2022-11-26  3:27 ` Martin K. Petersen
  2 siblings, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2022-11-17 18:13 UTC (permalink / raw)
  To: Xiu Jianfeng
  Cc: james.smart, dick.kennedy, jejb, martin.petersen, linux-scsi,
	linux-kernel


Xiu,

> User memset_startat() helper to simplify the code, no functional
> changes in this patch.

Applied to 6.2/scsi-staging, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH -next] scsi: lpfc: Use memset_startat() helper
  2022-11-11  7:43 [PATCH -next] scsi: lpfc: Use memset_startat() helper Xiu Jianfeng
  2022-11-12 16:50 ` James Smart
  2022-11-17 18:13 ` Martin K. Petersen
@ 2022-11-26  3:27 ` Martin K. Petersen
  2 siblings, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2022-11-26  3:27 UTC (permalink / raw)
  To: jejb, Xiu Jianfeng, dick.kennedy, james.smart
  Cc: Martin K . Petersen, linux-kernel, linux-scsi

On Fri, 11 Nov 2022 15:43:10 +0800, Xiu Jianfeng wrote:

> User memset_startat() helper to simplify the code, no functional
> changes in this patch.
> 
> 

Applied to 6.2/scsi-queue, thanks!

[1/1] scsi: lpfc: Use memset_startat() helper
      https://git.kernel.org/mkp/scsi/c/b29e91385ce2

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-11-26  3:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-11  7:43 [PATCH -next] scsi: lpfc: Use memset_startat() helper Xiu Jianfeng
2022-11-12 16:50 ` James Smart
2022-11-17 18:13 ` Martin K. Petersen
2022-11-26  3:27 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).