Skip to contentSkip to conversation

parport: remove non-zero check on count

PATCH In review Colin King 3 participants 3 messages Jul 30, 2021 – Aug 27, 2021

Subsystems (2)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 parport: remove non-zero check on count

From: Colin Ian King <[email protected]>

The check for count appears to be incorrect since a non-zero count check occurs a couple of statements earlier. Currently the check is always false and the dev->port->irq != PARPORT_IRQ_NONE part of the check is never tested and the if statement is dead-code. Fix this by removing the check on count.

Note that this code is pre-git history, so I can't find a sha for it.

Addresses-Coverity: ("Logically dead code")

---
 drivers/parport/ieee1284_ops.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/parport/ieee1284_ops.c +1 -1
index 2c11bd3fe1fd..17061f1df0f4 100644
@@ -518,7 +518,7 @@ size_t parport_ieee1284_ecp_read_data (struct parport *port,
 				goto out;
 
 			/* Yield the port for a while. */
-			if (count && dev->port->irq != PARPORT_IRQ_NONE) {
+			if (dev->port->irq != PARPORT_IRQ_NONE) {
 				parport_release (dev);
 				schedule_timeout_interruptible(msecs_to_jiffies(40));
 				parport_claim_or_block (dev);
Signature · 1 line
2.31.1
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Colin King

From: Colin Ian King <[email protected]>

The check for count appears to be incorrect since a non-zero count check occurs a couple of statements earlier. Currently the check is always false and the dev->port->irq != PARPORT_IRQ_NONE part of the check is never tested and the if statement is dead-code. Fix this by removing the check on count.

Quoted 5 lines

Note that this code is pre-git history, so I can't find a sha for it.

Addresses-Coverity: ("Logically dead code")

Greg, can you please take it through your tree..
I think you might not have it in your queue as you were not in the original recipient list, if so, I can send it after adding my Ack to it.

Signature · 2 lines
Regards
Sudip
#2 lore raw
Quoted 16 lines · Sudip Mukherjee
Quoted 9 lines · Colin King

From: Colin Ian King <[email protected]>

The check for count appears to be incorrect since a non-zero count check occurs a couple of statements earlier. Currently the check is always false and the dev->port->irq != PARPORT_IRQ_NONE part of the check is never tested and the if statement is dead-code. Fix this by removing the check on count.

Quoted 5 lines

Note that this code is pre-git history, so I can't find a sha for it.

Addresses-Coverity: ("Logically dead code")

Quoted 6 lines

Greg, can you please take it through your tree..
I think you might not have it in your queue as you were not in the original recipient list, if so, I can send it after adding my Ack to it.

Now picked up, thanks.

greg k-h