[media] snd_tea575x: precedence bug in fmr2_tea575x_get_pins()
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 22 Aug 2013 16:07:17 +0000 (13:07 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Mon, 14 Oct 2013 09:23:38 +0000 (06:23 -0300)
The "|" operation has higher precedence that "?:" so this couldn't
return both flags set at once as intended.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/media/radio/radio-sf16fmr2.c

index f1e3714b5f16cdf017a4868ab5eb31ecb5899515..620c4907e701b20d8f2dd830173eb6ece3f08cd6 100644 (file)
@@ -74,8 +74,8 @@ static u8 fmr2_tea575x_get_pins(struct snd_tea575x *tea)
        struct fmr2 *fmr2 = tea->private_data;
        u8 bits = inb(fmr2->io);
 
-       return  (bits & STR_DATA) ? TEA575X_DATA : 0 |
-               (bits & STR_MOST) ? TEA575X_MOST : 0;
+       return  ((bits & STR_DATA) ? TEA575X_DATA : 0) |
+               ((bits & STR_MOST) ? TEA575X_MOST : 0);
 }
 
 static void fmr2_tea575x_set_direction(struct snd_tea575x *tea, bool output)