]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
scsi: qla4xxx: Use correct variable in memset for clarity
authorAlok Tiwari <alok.a.tiwari@oracle.com>
Tue, 21 Oct 2025 09:03:52 +0000 (02:03 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 24 Oct 2025 03:02:15 +0000 (23:02 -0400)
Both mbox_cmd and mbox_sts have the same size, so using sizeof(mbox_cmd)
when clearing mbox_sts did not cause any functional issue. However, it
is misleading and reduces code readability.

Update the memset() calls to use sizeof(mbox_sts) to make the intent
clear

Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
Link: https://patch.msgid.link/20251021090354.1804327-1-alok.a.tiwari@oracle.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/qla4xxx/ql4_mbx.c

index 75125d2021f5f635ebabe783a3b4a8a9c7e63040..7febc0baa9d60667309661c053141cc2bacebf8b 100644 (file)
@@ -1016,7 +1016,7 @@ void qla4xxx_get_crash_record(struct scsi_qla_host * ha)
        uint32_t crash_record_size = 0;
 
        memset(&mbox_cmd, 0, sizeof(mbox_cmd));
-       memset(&mbox_sts, 0, sizeof(mbox_cmd));
+       memset(&mbox_sts, 0, sizeof(mbox_sts));
 
        /* Get size of crash record. */
        mbox_cmd[0] = MBOX_CMD_GET_CRASH_RECORD;
@@ -1099,7 +1099,7 @@ void qla4xxx_get_conn_event_log(struct scsi_qla_host * ha)
 
        /* Get Crash Record. */
        memset(&mbox_cmd, 0, sizeof(mbox_cmd));
-       memset(&mbox_sts, 0, sizeof(mbox_cmd));
+       memset(&mbox_sts, 0, sizeof(mbox_sts));
 
        mbox_cmd[0] = MBOX_CMD_GET_CONN_EVENT_LOG;
        mbox_cmd[2] = LSDW(event_log_dma);