Skip to contentSkip to conversation

V4L/DVB: &&/|| confusion in medusa_set_decoderduration()

PATCH New roel kluin 1 participant 1 message Jan 1, 2011 Staging

lore
Share & tools
lore

roel kluin

author
#0 lore raw

PATCH 1/1 V4L/DVB: &&/|| confusion in medusa_set_decoderduration()

Since VDEC_A is defined less than VDEC_H the if-branch was always taken.

---
 drivers/staging/cx25821/cx25821-medusa-video.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

See drivers/staging/cx25821/cx25821-medusa-defines.h:27 for VDEC_* definitions:
#define VDEC_A 0
...
#define VDEC_H 7

drivers/staging/cx25821/cx25821-medusa-video.c +1 -1
index 1e11e0c..00fb56f 100644
@@ -564,7 +564,7 @@ static void medusa_set_decoderduration(struct cx25821_dev *dev, int decoder,
 	mutex_lock(&dev->lock);
 
 	/* no support */
-	if (decoder < VDEC_A && decoder > VDEC_H) {
+	if (decoder < VDEC_A || decoder > VDEC_H) {
 		mutex_unlock(&dev->lock);
 		return;
 	}