aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/scsi/scsi_debug.c
diff options
context:
space:
mode:
authorNathan Chancellor <nathan@kernel.org>2025-04-29 17:46:49 -0700
committerMartin K. Petersen <martin.petersen@oracle.com>2025-05-05 21:58:21 -0400
commitbf6971a2b3eeb13535c907c03589f82a1adc429e (patch)
tree03da3f8cf38660a4703e875c732faea6a30fae7c /drivers/scsi/scsi_debug.c
parentMerge patch series "scsi: ufs-qcom: Enable Hibern8, MCQ, and Testbus registers Dump" (diff)
downloadwireguard-linux-bf6971a2b3eeb13535c907c03589f82a1adc429e.tar.xz
wireguard-linux-bf6971a2b3eeb13535c907c03589f82a1adc429e.zip
scsi: dc395x: Remove leftover if statement in reselect()
Clang warns (or errors with CONFIG_WERROR=y): drivers/scsi/dc395x.c:2553:6: error: variable 'id' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized] 2553 | if (!(rsel_tar_lun_id & (IDENTIFY_BASE << 8))) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/scsi/dc395x.c:2556:22: note: uninitialized use occurs here 2556 | dcb = find_dcb(acb, id, lun); | ^~ drivers/scsi/dc395x.c:2553:2: note: remove the 'if' if its condition is always true 2553 | if (!(rsel_tar_lun_id & (IDENTIFY_BASE << 8))) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2554 | id = rsel_tar_lun_id & 0xff; This if statement only existed for a debugging print but it was not removed with the debugging print in a recent cleanup, leading to id only being initialized when the if condition is true. Remove the if statement to ensure id is always initialized, clearing up the warning. Fixes: 62b434b0db2c ("scsi: dc395x: Remove DEBUG conditional compilation") Signed-off-by: Nathan Chancellor <nathan@kernel.org> Link: https://lore.kernel.org/r/20250429-scsi-dc395x-fix-uninit-var-v1-1-25215d481020@kernel.org Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/scsi_debug.c')
0 files changed, 0 insertions, 0 deletions