All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: qla4xxx: remove redundant check on drvr_wait
@ 2018-09-26 13:08 ` Colin King
  0 siblings, 0 replies; 12+ messages in thread
From: Colin King @ 2018-09-26 13:08 UTC (permalink / raw)
  To: QLogic-Storage-Upstream, James E . J . Bottomley,
	Martin K . Petersen, linux-scsi
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

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>
---
 drivers/scsi/qla4xxx/ql4_init.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/scsi/qla4xxx/ql4_init.c b/drivers/scsi/qla4xxx/ql4_init.c
index 52b1a0bc93c9..1ef74aa2d00a 100644
--- a/drivers/scsi/qla4xxx/ql4_init.c
+++ b/drivers/scsi/qla4xxx/ql4_init.c
@@ -766,12 +766,10 @@ int ql4xxx_lock_drvr_wait(struct scsi_qla_host *a)
 	while (drvr_wait) {
 		if (ql4xxx_lock_drvr(a) = 0) {
 			ssleep(QL4_LOCK_DRVR_SLEEP);
-			if (drvr_wait) {
-				DEBUG2(printk("scsi%ld: %s: Waiting for "
-					      "Global Init Semaphore(%d)...\n",
-					      a->host_no,
-					      __func__, drvr_wait));
-			}
+			DEBUG2(printk("scsi%ld: %s: Waiting for "
+				      "Global Init Semaphore(%d)...\n",
+				      a->host_no,
+				      __func__, drvr_wait));
 			drvr_wait -= QL4_LOCK_DRVR_SLEEP;
 		} else {
 			DEBUG2(printk("scsi%ld: %s: Global Init Semaphore "
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2020-12-09 17:24 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-26 13:08 [PATCH] scsi: qla4xxx: remove redundant check on drvr_wait Colin King
2018-09-26 13:08 ` Colin King
2018-09-27 11:15 ` Rangankar, Manish
2018-09-27 11:15   ` Rangankar, Manish
2020-12-04 19:18   ` [PATCH] scsi: qla4xxx: remove redundant assignment to variable rval Colin King
2020-12-04 19:18     ` Colin King
2020-12-08  1:58     ` Martin K. Petersen
2020-12-08  1:58       ` Martin K. Petersen
2020-12-09 17:23     ` Martin K. Petersen
2020-12-09 17:23       ` Martin K. Petersen
2018-09-28  6:30 ` [PATCH] scsi: qla4xxx: remove redundant check on drvr_wait Martin K. Petersen
2018-09-28  6:30   ` Martin K. Petersen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.