mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] scsi: lpfc: correct size for wqe for memset
@ 2024-03-01 14:44 Muhammad Usama Anjum
  2024-03-01 19:02 ` Justin Tee
  2024-03-04 10:19 ` AngeloGioacchino Del Regno
  0 siblings, 2 replies; 4+ messages in thread
From: Muhammad Usama Anjum @ 2024-03-01 14:44 UTC (permalink / raw)
  To: James Smart, Dick Kennedy, James E.J. Bottomley,
	Martin K. Petersen, Hannes Reinecke
  Cc: Muhammad Usama Anjum, kernel, kernel-janitors, James Smart,
	linux-scsi, linux-kernel

The wqe is of type lpfc_wqe128. It should be memset with the same type.

Fixes: 6c621a2229b0 ("scsi: lpfc: Separate NVMET RQ buffer posting from IO resources SGL/iocbq/context")
Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
---
 drivers/scsi/lpfc/lpfc_nvmet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/lpfc/lpfc_nvmet.c b/drivers/scsi/lpfc/lpfc_nvmet.c
index 8258b771bd009..29bc6cd10fd69 100644
--- a/drivers/scsi/lpfc/lpfc_nvmet.c
+++ b/drivers/scsi/lpfc/lpfc_nvmet.c
@@ -1586,7 +1586,7 @@ lpfc_nvmet_setup_io_context(struct lpfc_hba *phba)
 		wqe = &nvmewqe->wqe;
 
 		/* Initialize WQE */
-		memset(wqe, 0, sizeof(union lpfc_wqe));
+		memset(wqe, 0, sizeof(union lpfc_wqe128));
 
 		ctx_buf->iocbq->cmd_dmabuf = NULL;
 		spin_lock(&phba->sli4_hba.sgl_list_lock);
-- 
2.39.2


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

* Re: [PATCH] scsi: lpfc: correct size for wqe for memset
  2024-03-01 14:44 [PATCH] scsi: lpfc: correct size for wqe for memset Muhammad Usama Anjum
@ 2024-03-01 19:02 ` Justin Tee
  2024-03-04  8:45   ` Muhammad Usama Anjum
  2024-03-04 10:19 ` AngeloGioacchino Del Regno
  1 sibling, 1 reply; 4+ messages in thread
From: Justin Tee @ 2024-03-01 19:02 UTC (permalink / raw)
  To: Muhammad Usama Anjum
  Cc: James Smart, Dick Kennedy, Justin Tee, James E.J. Bottomley,
	Martin K. Petersen, Hannes Reinecke, kernel, kernel-janitors,
	James Smart, linux-scsi, linux-kernel

Hi Muhammad,

> -               memset(wqe, 0, sizeof(union lpfc_wqe));
> +               memset(wqe, 0, sizeof(union lpfc_wqe128));

How about instead memset(wqe, 0, sizeof(*wqe));

Thanks,
Justin

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

* Re: [PATCH] scsi: lpfc: correct size for wqe for memset
  2024-03-01 19:02 ` Justin Tee
@ 2024-03-04  8:45   ` Muhammad Usama Anjum
  0 siblings, 0 replies; 4+ messages in thread
From: Muhammad Usama Anjum @ 2024-03-04  8:45 UTC (permalink / raw)
  To: Justin Tee
  Cc: Muhammad Usama Anjum, James Smart, Dick Kennedy, Justin Tee,
	James E.J. Bottomley, Martin K. Petersen, Hannes Reinecke,
	kernel, kernel-janitors, James Smart, linux-scsi, linux-kernel

I'll send v2.

On 3/2/24 12:02 AM, Justin Tee wrote:
> Hi Muhammad,
> 
>> -               memset(wqe, 0, sizeof(union lpfc_wqe));
>> +               memset(wqe, 0, sizeof(union lpfc_wqe128));
> 
> How about instead memset(wqe, 0, sizeof(*wqe));
> 
> Thanks,
> Justin
> 

-- 
BR,
Muhammad Usama Anjum

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

* Re: [PATCH] scsi: lpfc: correct size for wqe for memset
  2024-03-01 14:44 [PATCH] scsi: lpfc: correct size for wqe for memset Muhammad Usama Anjum
  2024-03-01 19:02 ` Justin Tee
@ 2024-03-04 10:19 ` AngeloGioacchino Del Regno
  1 sibling, 0 replies; 4+ messages in thread
From: AngeloGioacchino Del Regno @ 2024-03-04 10:19 UTC (permalink / raw)
  To: Muhammad Usama Anjum, James Smart, Dick Kennedy,
	James E.J. Bottomley, Martin K. Petersen, Hannes Reinecke
  Cc: kernel, kernel-janitors, James Smart, linux-scsi, linux-kernel

Il 01/03/24 15:44, Muhammad Usama Anjum ha scritto:
> The wqe is of type lpfc_wqe128. It should be memset with the same type.
> 
> Fixes: 6c621a2229b0 ("scsi: lpfc: Separate NVMET RQ buffer posting from IO resources SGL/iocbq/context")
> Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
> ---
>   drivers/scsi/lpfc/lpfc_nvmet.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/lpfc/lpfc_nvmet.c b/drivers/scsi/lpfc/lpfc_nvmet.c
> index 8258b771bd009..29bc6cd10fd69 100644
> --- a/drivers/scsi/lpfc/lpfc_nvmet.c
> +++ b/drivers/scsi/lpfc/lpfc_nvmet.c
> @@ -1586,7 +1586,7 @@ lpfc_nvmet_setup_io_context(struct lpfc_hba *phba)
>   		wqe = &nvmewqe->wqe;
>   
>   		/* Initialize WQE */
> -		memset(wqe, 0, sizeof(union lpfc_wqe));
> +		memset(wqe, 0, sizeof(union lpfc_wqe128));

memset(wqe, 0, sizeof(*wqe));

Cheers,
Angelo

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

end of thread, other threads:[~2024-03-04 10:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-01 14:44 [PATCH] scsi: lpfc: correct size for wqe for memset Muhammad Usama Anjum
2024-03-01 19:02 ` Justin Tee
2024-03-04  8:45   ` Muhammad Usama Anjum
2024-03-04 10:19 ` AngeloGioacchino Del Regno

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®