Skip to contentSkip to conversation

scsi: initio: remove redundant assignment to pointer scb

PATCH Applied Colin Ian King 2 participants 3 messages Aug 5, 2022 – Sep 1, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: initio: remove redundant assignment to pointer scb

The variable scb is assigned a value but it is never read. The assignment is redundant and can be removed. Also replace the != NULL check with the more usual non-null check idiom.

Cleans up clang scan build warning:
drivers/scsi/initio.c:1169:9: warning: Although the value stored to 'scb' is used in the enclosing expression, the value is never actually read from 'scb' [deadcode.DeadStores]

---
 drivers/scsi/initio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/initio.c +1 -1
index f585d6e5fab9..375261d67619 100644
@@ -1166,7 +1166,7 @@ static void tulip_scsi(struct initio_host * host)
 			return;
 		}
 		if (host->jsint & (TSS_FUNC_COMP | TSS_BUS_SERV)) {	/* func complete or Bus service */
-			if ((scb = host->active) != NULL)
+			if (host->active)
 				initio_next_state(host);
 			return;
 		}
Signature · 1 line
2.35.3
#1 lore raw

Colin,

Quoted 3 lines

The variable scb is assigned a value but it is never read. The assignment is redundant and can be removed. Also replace the != NULL check with the more usual non-null check idiom.

Applied to 6.1/scsi-staging, thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering
#2 lore raw
In reply to Colin Ian King
Quoted 10 lines · Colin Ian King

The variable scb is assigned a value but it is never read. The assignment is redundant and can be removed. Also replace the != NULL check with the more usual non-null check idiom.

Cleans up clang scan build warning:
drivers/scsi/initio.c:1169:9: warning: Although the value stored to 'scb' is used in the enclosing expression, the value is never actually read from 'scb' [deadcode.DeadStores]

[...]

Applied to 6.1/scsi-queue, thanks!

[1/1] scsi: initio: remove redundant assignment to pointer scb

      https://git.kernel.org/mkp/scsi/c/3fa5975b07e9
Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering