scsi: vmw_pvscsi: No need to clear memory after a dma_alloc_coherent() call
Subsystems (3)
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.
Signed-off-by Christophe JAILLET <[email protected]>
--- drivers/scsi/vmw_pvscsi.c | 1 - 1 file changed, 1 deletion(-)
drivers/scsi/vmw_pvscsi.c +0 -1
@@ -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
Martin K. Petersen
AppliedChristophe,
Quoted 2 lines
dma_alloc_coherent()already clear the allocated memory, there is no need to explicitly callmemset().
Applied to 5.19/scsi-staging, thanks!
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering