Re: stv680 boolean logic bug.

From: Olivier Galibert
Date: Fri Jun 23 2006 - 05:58:06 EST


On Thu, Jun 22, 2006 at 08:40:33PM -0400, Dave Jones wrote:
> 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);
> }

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

OG.

-
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/