public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] [media] snd_tea575x: precedence bug in fmr2_tea575x_get_pins()
@ 2013-08-22 17:07 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2013-08-22 17:07 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: Greg Kroah-Hartman, linux-media, kernel-janitors

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>
---
Static checker stuff.  Untested.

diff --git a/drivers/media/radio/radio-sf16fmr2.c b/drivers/media/radio/radio-sf16fmr2.c
index 9c09904..72af59d 100644
--- a/drivers/media/radio/radio-sf16fmr2.c
+++ b/drivers/media/radio/radio-sf16fmr2.c
@@ -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)

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-08-22 17:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-22 17:07 [patch] [media] snd_tea575x: precedence bug in fmr2_tea575x_get_pins() Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox