Skip to contentSkip to conversation

stv680 boolean logic bug.

PATCH Dave Jones 2 participants 2 messages Jun 23, 2006 Media (V4L/DVB)

lore
Share & tools
lore

Dave Jones

author
#0 lore raw

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

drivers/media/video/stv680.c renamed from drivers/media/video/stv680.c~ +2 -1
@@ -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);
 	}
 
Signature · 1 line
http://www.codemonkey.org.uk
#1 lore raw
Quoted 8 lines · Dave Jones

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

drivers/media/video/stv680.c static void bayer_unshuffle (struct usb_ · line 980

Quoted 8 lines
drivers/media/video/stv680.c renamed from drivers/media/video/stv680.c~ +2 -1
@@ -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);
 	}

That looks very wrong. You're turning a circular buffer into... whatever.

OG.