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

scsi: qla4xxx: Remove redundant check on drvr_wait

The check for a non-zero drvr_wait is redundant as the same check is performed
earlier in the outer while loop, the inner check will always be true if we
reached this point inside the while loop. Remove the redundant if check.

Detected by cppcheck:
(warning) Identical inner 'if' condition is always true.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Manish Rangankar <Manish.Rangankar@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Colin Ian King and committed by
Martin K. Petersen
eec73c2e 9fe278f4

+4 -6
+4 -6
drivers/scsi/qla4xxx/ql4_init.c
··· 766 766 while (drvr_wait) { 767 767 if (ql4xxx_lock_drvr(a) == 0) { 768 768 ssleep(QL4_LOCK_DRVR_SLEEP); 769 - if (drvr_wait) { 770 - DEBUG2(printk("scsi%ld: %s: Waiting for " 771 - "Global Init Semaphore(%d)...\n", 772 - a->host_no, 773 - __func__, drvr_wait)); 774 - } 769 + DEBUG2(printk("scsi%ld: %s: Waiting for " 770 + "Global Init Semaphore(%d)...\n", 771 + a->host_no, 772 + __func__, drvr_wait)); 775 773 drvr_wait -= QL4_LOCK_DRVR_SLEEP; 776 774 } else { 777 775 DEBUG2(printk("scsi%ld: %s: Global Init Semaphore "