]> git.baikalelectronics.ru Git - kernel.git/commitdiff
parport: remove non-zero check on count
authorColin Ian King <colin.king@canonical.com>
Fri, 30 Jul 2021 10:07:10 +0000 (11:07 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Sep 2021 10:26:36 +0000 (12:26 +0200)
[ Upstream commit 0be883a0d795d9146f5325de582584147dd0dcdc ]

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.

Acked-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Addresses-Coverity: ("Logically dead code")
Link: https://lore.kernel.org/r/20210730100710.27405-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/parport/ieee1284_ops.c

index 5d41dda6da4e7bdc7028264b7ddd96a6356e9fb3..75daa16f38b7fc34e9fe53941d65c554f3538c25 100644 (file)
@@ -535,7 +535,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);