Skip to contentSkip to conversation

scsi: mpt3sas: clean up a sizeof()

PATCH Superseded Dan Carpenter 2 participants 3 messages Jun 26, 2019

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: mpt3sas: clean up a sizeof()

This patch is just a cleanup and doesn't change run time because both sizeof EVENT and SCSI are 84 bytes. But this is clearly a cut and paste error and the SCSI struct was intended.

---
 drivers/scsi/mpt3sas/mpt3sas_ctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/mpt3sas/mpt3sas_ctl.c +1 -1
index d4ecfbbe738c..06a901ed743c 100644
@@ -3280,7 +3280,7 @@ diag_trigger_scsi_store(struct device *cdev,
 	spin_lock_irqsave(&ioc->diag_trigger_lock, flags);
 	sz = min(sizeof(struct SL_WH_SCSI_TRIGGERS_T), count);
 	memset(&ioc->diag_trigger_scsi, 0,
-	    sizeof(struct SL_WH_EVENT_TRIGGERS_T));
+	    sizeof(struct SL_WH_SCSI_TRIGGERS_T));
 	memcpy(&ioc->diag_trigger_scsi, buf, sz);
 	if (ioc->diag_trigger_scsi.ValidEntries > NUM_VALID_ENTRIES)
 		ioc->diag_trigger_scsi.ValidEntries = NUM_VALID_ENTRIES;
Signature · 1 line
2.20.1
#1 lore raw
Quoted 16 lines · Dan Carpenter

This patch is just a cleanup and doesn't change run time because both sizeof EVENT and SCSI are 84 bytes. But this is clearly a cut and paste
error and the SCSI struct was intended.

---
 drivers/scsi/mpt3sas/mpt3sas_ctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/mpt3sas/mpt3sas_ctl.c +0 -0
index d4ecfbbe738c..06a901ed743c 100644

drivers/scsi/mpt3sas/mpt3sas_ctl.c diag_trigger_scsi_store(struct device *cdev, · line 3283

Quoted 5 lines
drivers/scsi/mpt3sas/mpt3sas_ctl.c +1 -1
@@ -3280,7 +3280,7 @@ diag_trigger_scsi_store(struct device *cdev,
 	spin_lock_irqsave(&ioc->diag_trigger_lock, flags);
 	sz = min(sizeof(struct SL_WH_SCSI_TRIGGERS_T), count);
 	memset(&ioc->diag_trigger_scsi, 0,
-	    sizeof(struct SL_WH_EVENT_TRIGGERS_T));
+	    sizeof(struct SL_WH_SCSI_TRIGGERS_T));

Please can we make this the correct pattern of

sizeof(ioc->diag_trigger_scsi)

James

#2 lore raw
In reply to Dan Carpenter
Quoted 25 lines · James Bottomley
Quoted 16 lines · Dan Carpenter

This patch is just a cleanup and doesn't change run time because both sizeof EVENT and SCSI are 84 bytes. But this is clearly a cut and paste
error and the SCSI struct was intended.

---
 drivers/scsi/mpt3sas/mpt3sas_ctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/mpt3sas/mpt3sas_ctl.c +0 -0
index d4ecfbbe738c..06a901ed743c 100644

drivers/scsi/mpt3sas/mpt3sas_ctl.c diag_trigger_scsi_store(struct device *cdev, · line 3283

Quoted 5 lines
drivers/scsi/mpt3sas/mpt3sas_ctl.c +1 -1
@@ -3280,7 +3280,7 @@ diag_trigger_scsi_store(struct device *cdev,
 	spin_lock_irqsave(&ioc->diag_trigger_lock, flags);
 	sz = min(sizeof(struct SL_WH_SCSI_TRIGGERS_T), count);
 	memset(&ioc->diag_trigger_scsi, 0,
-	    sizeof(struct SL_WH_EVENT_TRIGGERS_T));
+	    sizeof(struct SL_WH_SCSI_TRIGGERS_T));

Please can we make this the correct pattern of

Quoted 1 line

sizeof(ioc->diag_trigger_scsi)

Sure. I'll resend.

regards,
dan carpenter