* stv680 boolean logic bug.
@ 2006-06-23 0:40 Dave Jones
2006-06-23 9:59 ` Olivier Galibert
0 siblings, 1 reply; 2+ messages in thread
From: Dave Jones @ 2006-06-23 0:40 UTC (permalink / raw)
To: Linux Kernel; +Cc: akpm
This looks closer to what I believe the original intent was.
(Also fixes line-len to meet CodingStyle)
Signed-off-by: Dave Jones <davej@redhat.com>
--- 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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: stv680 boolean logic bug.
2006-06-23 0:40 stv680 boolean logic bug Dave Jones
@ 2006-06-23 9:59 ` Olivier Galibert
0 siblings, 0 replies; 2+ messages in thread
From: Olivier Galibert @ 2006-06-23 9:59 UTC (permalink / raw)
To: Dave Jones, Linux Kernel, akpm
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@redhat.com>
>
> --- 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.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-06-23 9:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-23 0:40 stv680 boolean logic bug Dave Jones
2006-06-23 9:59 ` Olivier Galibert
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox