All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: megaraid_sas: Remove redundant memset statement
@ 2022-05-05 14:32 Harshit Mogalapalli
  2022-05-17  2:11 ` Martin K. Petersen
  2022-05-20  1:09 ` Martin K. Petersen
  0 siblings, 2 replies; 3+ messages in thread
From: Harshit Mogalapalli @ 2022-05-05 14:32 UTC (permalink / raw)
  Cc: harshit.m.mogalapalli, dan.carpenter, Kashyap Desai,
	Sumit Saxena, Shivasharan S, James E.J. Bottomley,
	Martin K. Petersen, megaraidlinux.pdl, linux-scsi, linux-kernel

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

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] scsi: megaraid_sas: Remove redundant memset statement
  2022-05-05 14:32 [PATCH] scsi: megaraid_sas: Remove redundant memset statement Harshit Mogalapalli
@ 2022-05-17  2:11 ` Martin K. Petersen
  2022-05-20  1:09 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2022-05-17  2:11 UTC (permalink / raw)
  To: Harshit Mogalapalli
  Cc: dan.carpenter, Kashyap Desai, Sumit Saxena, Shivasharan S,
	James E.J. Bottomley, Martin K. Petersen, megaraidlinux.pdl,
	linux-scsi, linux-kernel


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	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] scsi: megaraid_sas: Remove redundant memset statement
  2022-05-05 14:32 [PATCH] scsi: megaraid_sas: Remove redundant memset statement Harshit Mogalapalli
  2022-05-17  2:11 ` Martin K. Petersen
@ 2022-05-20  1:09 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2022-05-20  1:09 UTC (permalink / raw)
  To: Harshit Mogalapalli
  Cc: Martin K . Petersen, linux-scsi, Kashyap Desai,
	megaraidlinux.pdl, Shivasharan S, James E.J. Bottomley,
	linux-kernel, Sumit Saxena, dan.carpenter

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

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-05-20  1:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-05 14:32 [PATCH] scsi: megaraid_sas: Remove redundant memset statement Harshit Mogalapalli
2022-05-17  2:11 ` Martin K. Petersen
2022-05-20  1:09 ` Martin K. Petersen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.