Skip to contentSkip to conversation

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

PATCH Applied Christophe JAILLET 2 participants 2 messages Mar 23, 2022 – Apr 7, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: vmw_pvscsi: 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().

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

---
 drivers/scsi/vmw_pvscsi.c | 1 -
 1 file changed, 1 deletion(-)
drivers/scsi/vmw_pvscsi.c +0 -1
index 1f037b8ab904..f88ecdb93a8a 100644
@@ -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;
 
Signature · 1 line
2.32.0
#1 lore raw

Christophe,

Quoted 2 lines

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

Applied to 5.19/scsi-staging, thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering