diff mbox series

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

Message ID cd1220c628c89465dcfcbf4aa9bd53110898a529.1648067518.git.christophe.jaillet@wanadoo.fr (mailing list archive)
State Accepted
Headers show
Series scsi: vmw_pvscsi: No need to clear memory after a dma_alloc_coherent() call | expand

Commit Message

Christophe JAILLET March 23, 2022, 8:32 p.m. UTC
dma_alloc_coherent() already clear the allocated memory, there is no need
to explicitly call memset().

Since 'config_page' and 'header' are the same, a memset() call can be
avoided.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/scsi/vmw_pvscsi.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Martin K. Petersen April 7, 2022, 3:02 a.m. UTC | #1
Christophe,

> dma_alloc_coherent() already clear the allocated memory, there is no
> need to explicitly call memset().

Applied to 5.19/scsi-staging, thanks!
diff mbox series

Patch

diff --git a/drivers/scsi/vmw_pvscsi.c b/drivers/scsi/vmw_pvscsi.c
index 1f037b8ab904..f88ecdb93a8a 100644
--- a/drivers/scsi/vmw_pvscsi.c
+++ b/drivers/scsi/vmw_pvscsi.c
@@ -1324,7 +1324,6 @@  static u32 pvscsi_get_max_targets(struct pvscsi_adapter *adapter)
 	 * indicate success.
 	 */
 	header = config_page;
-	memset(header, 0, sizeof *header);
 	header->hostStatus = BTSTAT_INVPARAM;
 	header->scsiStatus = SDSTAT_CHECK;