Commit 1de540a9 authored by Dan Carpenter's avatar Dan Carpenter Committed by Martin K. Petersen

scsi: mpt3sas: clean up a couple sizeof() uses

There is a copy and paste bug here.  It uses EVENT_TRIGGERS size instead of
SCSI_TRIGGERS size but fortunately both size are 84 bytes so it doesn't
affect runtime.

These days the preferred style is to just say sizeof(object) instead of
sizeof(type) so I have updated the function to the latest style as well.
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Acked-by: default avatarSreekanth Reddy <sreekanth.reddy@broadcom.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 16238355
......@@ -3278,9 +3278,8 @@ diag_trigger_scsi_store(struct device *cdev,
ssize_t sz;
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));
sz = min(sizeof(ioc->diag_trigger_scsi), count);
memset(&ioc->diag_trigger_scsi, 0, sizeof(ioc->diag_trigger_scsi));
memcpy(&ioc->diag_trigger_scsi, buf, sz);
if (ioc->diag_trigger_scsi.ValidEntries > NUM_VALID_ENTRIES)
ioc->diag_trigger_scsi.ValidEntries = NUM_VALID_ENTRIES;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment