Re: stv680 boolean logic bug.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <[email protected]>
> 
> --- 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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux