[<prev] [next>] [day] [month] [year] [list]
Message-Id: <57d6a4c0c44b9a33087d3f17a9cc245d1943d881.1668856835.git.christophe.jaillet@wanadoo.fr>
Date: Sat, 19 Nov 2022 12:20:49 +0100
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: Nilesh Javali <njavali@...vell.com>,
GR-QLogic-Storage-Upstream@...vell.com,
"James E.J. Bottomley" <jejb@...ux.ibm.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>
Cc: linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org,
Christophe JAILLET <christophe.jaillet@...adoo.fr>,
linux-scsi@...r.kernel.org
Subject: [PATCH] scsi: qla2xxx: No need to clear memory after a dma_alloc_coherent() call
dma_alloc_coherent() already clear the allocated memory, there is no need
to explicitly call memset().
Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
---
Compile tested only
---
drivers/scsi/qla2xxx/qla_gs.c | 16 +++++-----------
1 file changed, 5 insertions(+), 11 deletions(-)
diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c
index 64ab070b8716..0afd6cee7113 100644
--- a/drivers/scsi/qla2xxx/qla_gs.c
+++ b/drivers/scsi/qla2xxx/qla_gs.c
@@ -622,8 +622,7 @@ static int qla_async_rftid(scsi_qla_host_t *vha, port_id_t *d_id)
__func__);
goto done_free_sp;
}
- ct_sns = (struct ct_sns_pkt *)sp->u.iocb_cmd.u.ctarg.rsp;
- memset(ct_sns, 0, sizeof(*ct_sns));
+
ct_sns = (struct ct_sns_pkt *)sp->u.iocb_cmd.u.ctarg.req;
/* Prepare CT request */
@@ -718,8 +717,7 @@ static int qla_async_rffid(scsi_qla_host_t *vha, port_id_t *d_id,
__func__);
goto done_free_sp;
}
- ct_sns = (struct ct_sns_pkt *)sp->u.iocb_cmd.u.ctarg.rsp;
- memset(ct_sns, 0, sizeof(*ct_sns));
+
ct_sns = (struct ct_sns_pkt *)sp->u.iocb_cmd.u.ctarg.req;
/* Prepare CT request */
@@ -810,8 +808,7 @@ static int qla_async_rnnid(scsi_qla_host_t *vha, port_id_t *d_id,
__func__);
goto done_free_sp;
}
- ct_sns = (struct ct_sns_pkt *)sp->u.iocb_cmd.u.ctarg.rsp;
- memset(ct_sns, 0, sizeof(*ct_sns));
+
ct_sns = (struct ct_sns_pkt *)sp->u.iocb_cmd.u.ctarg.req;
/* Prepare CT request */
@@ -917,8 +914,7 @@ static int qla_async_rsnn_nn(scsi_qla_host_t *vha)
__func__);
goto done_free_sp;
}
- ct_sns = (struct ct_sns_pkt *)sp->u.iocb_cmd.u.ctarg.rsp;
- memset(ct_sns, 0, sizeof(*ct_sns));
+
ct_sns = (struct ct_sns_pkt *)sp->u.iocb_cmd.u.ctarg.req;
/* Prepare CT request */
@@ -3228,10 +3224,8 @@ int qla24xx_async_gpnid(scsi_qla_host_t *vha, port_id_t *id)
goto done_free_sp;
}
- ct_sns = (struct ct_sns_pkt *)sp->u.iocb_cmd.u.ctarg.rsp;
- memset(ct_sns, 0, sizeof(*ct_sns));
-
ct_sns = (struct ct_sns_pkt *)sp->u.iocb_cmd.u.ctarg.req;
+
/* CT_IU preamble */
ct_req = qla2x00_prep_ct_req(ct_sns, GPN_ID_CMD, GPN_ID_RSP_SIZE);
--
2.34.1
Powered by blists - more mailing lists