diff mbox series

scsi: initio: remove redundant assignment to pointer scb

Message ID 20220805114100.2339637-1-colin.i.king@gmail.com
State New
Headers show
Series scsi: initio: remove redundant assignment to pointer scb | expand

Commit Message

Colin Ian King Aug. 5, 2022, 11:41 a.m. UTC
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]

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 drivers/scsi/initio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Martin K. Petersen Aug. 23, 2022, 3:43 a.m. UTC | #1
Colin,

> 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!
Martin K. Petersen Sept. 1, 2022, 5:12 a.m. UTC | #2
On Fri, 5 Aug 2022 12:41:00 +0100, Colin Ian King wrote:

> 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
diff mbox series

Patch

diff --git a/drivers/scsi/initio.c b/drivers/scsi/initio.c
index f585d6e5fab9..375261d67619 100644
--- a/drivers/scsi/initio.c
+++ b/drivers/scsi/initio.c
@@ -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;
 		}