diff mbox series

scsi: qla2xxx: No need to clear memory after a dma_alloc_coherent() call

Message ID 57d6a4c0c44b9a33087d3f17a9cc245d1943d881.1668856835.git.christophe.jaillet@wanadoo.fr
State New
Headers show
Series scsi: qla2xxx: No need to clear memory after a dma_alloc_coherent() call | expand

Commit Message

Christophe JAILLET Nov. 19, 2022, 11:20 a.m. UTC
dma_alloc_coherent() already clear the allocated memory, there is no need
to explicitly call memset().

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
Compile tested only
---
 drivers/scsi/qla2xxx/qla_gs.c | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)
diff mbox series

Patch

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);