[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ea3b75ed0811240913k7f19f8a3j5207b971a3fb6687@mail.gmail.com>
Date: Mon, 24 Nov 2008 12:13:14 -0500
From: "Brian Phelps" <lm317t@...il.com>
To: "Vegard Nossum" <vegard.nossum@...il.com>
Cc: "Mauro Carvalho Chehab" <mchehab@...radead.org>,
"Gerd Knorr" <kraxel@...esex.org>, linux-kernel@...r.kernel.org,
"Al Viro" <viro@...iv.linux.org.uk>,
"Mikael Pettersson" <mikpe@...uu.se>,
"Alexander Shaduri" <ashaduri@...il.com>,
"Alexey Dobriyan" <adobriyan@...il.com>,
"Rafael J. Wysocki" <rjw@...k.pl>, "Julia Lawall" <julia@...u.dk>
Subject: Re: [PATCH] bttv: don't compare list_head's .next with NULL
This patch seems to cause a select timeout to occur with v4l2's
example capture.c file
On Sat, Nov 22, 2008 at 6:20 AM, Vegard Nossum <vegard.nossum@...il.com> wrote:
> Hi Brian,
>
> Can you see if this patch helps your problem?
>
>
> Vegard
>
>
> From 84396b14b9059de4a697df4ea4e036a22513436e Mon Sep 17 00:00:00 2001
> From: Vegard Nossum <vegard.nossum@...il.com>
> Date: Sat, 22 Nov 2008 12:12:11 +0100
> Subject: [PATCH] bttv: don't compare list_head's .next with NULL
>
> The list implementation doesn't store NULLs in .next/.prev, but
> uses poison values (for-sure invalid pointers). I assume that this
> code wanted to test whether an entry was the last in a list.
>
> This function is only ever called for the video capture list, so
> we know which list to check (it could have been vcapture as well).
>
> Patch is untested!
>
> Signed-off-by: Vegard Nossum <vegard.nossum@...il.com>
> ---
> drivers/media/video/bt8xx/bttv-risc.c | 10 +++++-----
> 1 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/media/video/bt8xx/bttv-risc.c b/drivers/media/video/bt8xx/bttv-risc.c
> index 5b1b8e4..7a54c99 100644
> --- a/drivers/media/video/bt8xx/bttv-risc.c
> +++ b/drivers/media/video/bt8xx/bttv-risc.c
> @@ -649,14 +649,14 @@ bttv_buffer_activate_video(struct bttv *btv,
> if (NULL != set->top && NULL != set->bottom) {
> if (set->top == set->bottom) {
> set->top->vb.state = VIDEOBUF_ACTIVE;
> - if (set->top->vb.queue.next)
> + if (list_is_last(&set->top->vb.queue, &btv->capture))
> list_del(&set->top->vb.queue);
> } else {
> set->top->vb.state = VIDEOBUF_ACTIVE;
> set->bottom->vb.state = VIDEOBUF_ACTIVE;
> - if (set->top->vb.queue.next)
> + if (list_is_last(&set->top->vb.queue, &btv->capture))
> list_del(&set->top->vb.queue);
> - if (set->bottom->vb.queue.next)
> + if (list_is_last(&set->bottom->vb.queue, &btv->capture))
> list_del(&set->bottom->vb.queue);
> }
> bttv_apply_geo(btv, &set->top->geo, 1);
> @@ -671,7 +671,7 @@ bttv_buffer_activate_video(struct bttv *btv,
> ~0x0f, BT848_COLOR_CTL);
> } else if (NULL != set->top) {
> set->top->vb.state = VIDEOBUF_ACTIVE;
> - if (set->top->vb.queue.next)
> + if (list_is_last(&set->top->vb.queue, &btv->capture))
> list_del(&set->top->vb.queue);
> bttv_apply_geo(btv, &set->top->geo,1);
> bttv_apply_geo(btv, &set->top->geo,0);
> @@ -682,7 +682,7 @@ bttv_buffer_activate_video(struct bttv *btv,
> btaor(set->top->btswap & 0x0f, ~0x0f, BT848_COLOR_CTL);
> } else if (NULL != set->bottom) {
> set->bottom->vb.state = VIDEOBUF_ACTIVE;
> - if (set->bottom->vb.queue.next)
> + if (list_is_last(&set->bottom->vb.queue, &btv->capture))
> list_del(&set->bottom->vb.queue);
> bttv_apply_geo(btv, &set->bottom->geo,1);
> bttv_apply_geo(btv, &set->bottom->geo,0);
> --
> 1.5.6.5
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists