Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

scsi: qla4xxx: Use correct variable in memset for clarity

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>

authored by

Alok Tiwari and committed by
Martin K. Petersen
e9ff858c e414748b

+2 -2
+2 -2
drivers/scsi/qla4xxx/ql4_mbx.c
··· 1016 1016 uint32_t crash_record_size = 0; 1017 1017 1018 1018 memset(&mbox_cmd, 0, sizeof(mbox_cmd)); 1019 - memset(&mbox_sts, 0, sizeof(mbox_cmd)); 1019 + memset(&mbox_sts, 0, sizeof(mbox_sts)); 1020 1020 1021 1021 /* Get size of crash record. */ 1022 1022 mbox_cmd[0] = MBOX_CMD_GET_CRASH_RECORD; ··· 1099 1099 1100 1100 /* Get Crash Record. */ 1101 1101 memset(&mbox_cmd, 0, sizeof(mbox_cmd)); 1102 - memset(&mbox_sts, 0, sizeof(mbox_cmd)); 1102 + memset(&mbox_sts, 0, sizeof(mbox_sts)); 1103 1103 1104 1104 mbox_cmd[0] = MBOX_CMD_GET_CONN_EVENT_LOG; 1105 1105 mbox_cmd[2] = LSDW(event_log_dma);