diff mbox series

scsi: megaraid_sas: Remove redundant memset statement

Message ID 20220505143214.44908-1-harshit.m.mogalapalli@oracle.com
State New
Headers show
Series scsi: megaraid_sas: Remove redundant memset statement | expand

Commit Message

Harshit Mogalapalli May 5, 2022, 2:32 p.m. UTC
As memset of 'scmd->sense_buffer' is immediately followed by a memcpy
where 'scmd->sense_buffer' is the destination, memset is redundant.

Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
---
 drivers/scsi/megaraid/megaraid_sas_fusion.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Martin K. Petersen May 17, 2022, 2:11 a.m. UTC | #1
Harshit,

> As memset of 'scmd->sense_buffer' is immediately followed by a memcpy
> where 'scmd->sense_buffer' is the destination, memset is redundant.

Applied to 5.19/scsi-staging, thanks!
Martin K. Petersen May 20, 2022, 1:09 a.m. UTC | #2
On Thu, 5 May 2022 07:32:13 -0700, Harshit Mogalapalli wrote:

> As memset of 'scmd->sense_buffer' is immediately followed by a memcpy
> where 'scmd->sense_buffer' is the destination, memset is redundant.
> 
> 

Applied to 5.19/scsi-queue, thanks!

[1/1] scsi: megaraid_sas: Remove redundant memset statement
      https://git.kernel.org/mkp/scsi/c/2f9e9a7b0ce3
diff mbox series

Patch

diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c
index 54fde2661952..5b5885d9732b 100644
--- a/drivers/scsi/megaraid/megaraid_sas_fusion.c
+++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c
@@ -2047,8 +2047,6 @@  map_cmd_status(struct fusion_context *fusion,
 
 		scmd->result = (DID_OK << 16) | ext_status;
 		if (ext_status == SAM_STAT_CHECK_CONDITION) {
-			memset(scmd->sense_buffer, 0,
-			       SCSI_SENSE_BUFFERSIZE);
 			memcpy(scmd->sense_buffer, sense,
 			       SCSI_SENSE_BUFFERSIZE);
 		}