[media] it913x.: Fix a misuse of ||
authorMalcolm Priestley <tvboxspy@gmail.com>
Mon, 7 May 2012 14:22:52 +0000 (11:22 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 15 May 2012 11:17:41 +0000 (08:17 -0300)
On Mon, 2012-05-07 at 07:45 -0300, Mauro Carvalho Chehab wrote:
> Malcolm,
>
> Em 04-04-2012 20:00, Joe Perches escreveu:
> > Likely these should be && not ||
> >
> > drivers/scsi/FlashPoint.c: if(bit_cnt != 0 || bit_cnt != 8)
>
> > drivers/media/dvb/dvb-usb/it913x.c: if (ret == 0 || ret != -EBUSY || ret != -ETIMEDOUT)
> > drivers/media/dvb/dvb-usb/it913x.c: if (ret == 0 || ret != -EBUSY || ret != -ETIMEDOUT)
>
> Could you please take a look on the above?

Hmm... yes, thanks, also a bug.

Just check for -EBUSY && -ETIMEDOUT

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/dvb/dvb-usb/it913x.c

index 482d249ca7f3f0613d8aee2bf7c3ca27804a908a..6244fe9d1a3abc269de7112beb9f3440641650e5 100644 (file)
@@ -81,7 +81,7 @@ static int it913x_bulk_write(struct usb_device *dev,
        for (i = 0; i < IT913X_RETRY; i++) {
                ret = usb_bulk_msg(dev, usb_sndbulkpipe(dev, pipe),
                                snd, len , &actual_l, IT913X_SND_TIMEOUT);
-               if (ret == 0 || ret != -EBUSY || ret != -ETIMEDOUT)
+               if (ret != -EBUSY && ret != -ETIMEDOUT)
                        break;
        }
 
@@ -99,7 +99,7 @@ static int it913x_bulk_read(struct usb_device *dev,
        for (i = 0; i < IT913X_RETRY; i++) {
                ret = usb_bulk_msg(dev, usb_rcvbulkpipe(dev, pipe),
                                 rev, len , &actual_l, IT913X_RCV_TIMEOUT);
-               if (ret == 0 || ret != -EBUSY || ret != -ETIMEDOUT)
+               if (ret != -EBUSY && ret != -ETIMEDOUT)
                        break;
        }