public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [patch RFC] [media] staging: solo6x10: fix | vs &
@ 2012-06-09  7:47 Dan Carpenter
  2012-06-10 20:58 ` Dan Carpenter
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2012-06-09  7:47 UTC (permalink / raw)
  To: Ben Collins
  Cc: Mauro Carvalho Chehab, Greg Kroah-Hartman, linux-media, devel,
	kernel-janitors

The test here is never true because '&' was used instead of '|'.  It was
the same as:

	if (status & ((1<<16) & (1<<17)) ...

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
I don't have this hardware and this one really should be tested or
checked by someone who knows the spec.  It could be that the intent was
to do:

	if ((status & SOLO_IIC_STATE_TRNS) &&
	    (status & SOLO_IIC_STATE_SIG_ERR) || ...

diff --git a/drivers/staging/media/solo6x10/i2c.c b/drivers/staging/media/solo6x10/i2c.c
index ef95a50..398070a 100644
--- a/drivers/staging/media/solo6x10/i2c.c
+++ b/drivers/staging/media/solo6x10/i2c.c
@@ -175,7 +175,7 @@ int solo_i2c_isr(struct solo_dev *solo_dev)
 
 	solo_reg_write(solo_dev, SOLO_IRQ_STAT, SOLO_IRQ_IIC);
 
-	if (status & (SOLO_IIC_STATE_TRNS & SOLO_IIC_STATE_SIG_ERR) ||
+	if (status & (SOLO_IIC_STATE_TRNS | SOLO_IIC_STATE_SIG_ERR) ||
 	    solo_dev->i2c_id < 0) {
 		solo_i2c_stop(solo_dev);
 		return -ENXIO;

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

end of thread, other threads:[~2012-06-15 16:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-09  7:47 [patch RFC] [media] staging: solo6x10: fix | vs & Dan Carpenter
2012-06-10 20:58 ` Dan Carpenter
2012-06-15 16:55   ` Ralph Metzler

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