stv680 boolean logic bug.

From: Dave Jones
Date: Thu Jun 22 2006 - 20:39:18 EST


This looks closer to what I believe the original intent was.
(Also fixes line-len to meet CodingStyle)

Signed-off-by: Dave Jones <davej@xxxxxxxxxx>

--- linux-2.6/drivers/media/video/stv680.c~ 2006-06-22 20:38:21.000000000 -0400
+++ linux-2.6/drivers/media/video/stv680.c 2006-06-22 20:39:02.000000000 -0400
@@ -974,7 +974,8 @@ static void bayer_unshuffle (struct usb_
frame->grabstate = FRAME_DONE;
stv680->framecount++;
stv680->readcount++;
- if (stv680->frame[(stv680->curframe + 1) & (STV680_NUMFRAMES - 1)].grabstate == FRAME_READY) {
+ if (stv680->frame[(stv680->curframe + 1) &&
+ (STV680_NUMFRAMES - 1)].grabstate == FRAME_READY) {
stv680->curframe = (stv680->curframe + 1) & (STV680_NUMFRAMES - 1);
}


--
http://www.codemonkey.org.uk
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/