scsi: mpt3sas: clean up a sizeof()
Subsystems (3)
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
@@ -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
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.Signed-off-by Dan Carpenter <[email protected]>--- drivers/scsi/mpt3sas/mpt3sas_ctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/scsi/mpt3sas/mpt3sas_ctl.c +0
-0
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
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.Signed-off-by Dan Carpenter <[email protected]>--- drivers/scsi/mpt3sas/mpt3sas_ctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/scsi/mpt3sas/mpt3sas_ctl.c +0
-0drivers/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