linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] parport: remove non-zero check on count
@ 2021-07-30 10:07 Colin King
  2021-08-19 20:52 ` Sudip Mukherjee
  0 siblings, 1 reply; 3+ messages in thread
From: Colin King @ 2021-07-30 10:07 UTC (permalink / raw)
  To: Sudip Mukherjee; +Cc: kernel-janitors, linux-kernel

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

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")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/parport/ieee1284_ops.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/parport/ieee1284_ops.c b/drivers/parport/ieee1284_ops.c
index 2c11bd3fe1fd..17061f1df0f4 100644
--- a/drivers/parport/ieee1284_ops.c
+++ b/drivers/parport/ieee1284_ops.c
@@ -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);
-- 
2.31.1


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

* Re: [PATCH] parport: remove non-zero check on count
  2021-07-30 10:07 [PATCH] parport: remove non-zero check on count Colin King
@ 2021-08-19 20:52 ` Sudip Mukherjee
  2021-08-27 14:18   ` Greg Kroah-Hartman
  0 siblings, 1 reply; 3+ messages in thread
From: Sudip Mukherjee @ 2021-08-19 20:52 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: kernel-janitors, linux-kernel, Colin King

On Fri, Jul 30, 2021 at 11:07 AM Colin King <colin.king@canonical.com> wrote:
>
> From: Colin Ian King <colin.king@canonical.com>
>
> 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")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Acked-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>

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.

-- 
Regards
Sudip

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

* Re: [PATCH] parport: remove non-zero check on count
  2021-08-19 20:52 ` Sudip Mukherjee
@ 2021-08-27 14:18   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 3+ messages in thread
From: Greg Kroah-Hartman @ 2021-08-27 14:18 UTC (permalink / raw)
  To: Sudip Mukherjee; +Cc: kernel-janitors, linux-kernel, Colin King

On Thu, Aug 19, 2021 at 09:52:07PM +0100, Sudip Mukherjee wrote:
> On Fri, Jul 30, 2021 at 11:07 AM Colin King <colin.king@canonical.com> wrote:
> >
> > From: Colin Ian King <colin.king@canonical.com>
> >
> > 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")
> > Signed-off-by: Colin Ian King <colin.king@canonical.com>
> 
> Acked-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
> 
> 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

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

end of thread, other threads:[~2021-08-27 14:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-30 10:07 [PATCH] parport: remove non-zero check on count Colin King
2021-08-19 20:52 ` Sudip Mukherjee
2021-08-27 14:18   ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).