* [PATCH] v4l/tvp514x: try_count reaches 0, not -1
@ 2009-02-09 21:57 Roel Kluin
2009-02-10 4:18 ` Hiremath, Vaibhav
2009-02-10 9:20 ` Roel Kluin
0 siblings, 2 replies; 3+ messages in thread
From: Roel Kluin @ 2009-02-09 21:57 UTC (permalink / raw)
To: hvaibhav, mchehab; +Cc: linux-media, video4linux-list
with while (try_count-- > 0) { ... } try_count reaches 0, not -1.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
diff --git a/drivers/media/video/tvp514x.c b/drivers/media/video/tvp514x.c
index 8e23aa5..5f4cbc2 100644
--- a/drivers/media/video/tvp514x.c
+++ b/drivers/media/video/tvp514x.c
@@ -686,7 +686,7 @@ static int ioctl_s_routing(struct v4l2_int_device *s,
break; /* Input detected */
}
- if ((current_std == STD_INVALID) || (try_count < 0))
+ if ((current_std == STD_INVALID) || (try_count <= 0))
return -EINVAL;
decoder->current_std = current_std;
^ permalink raw reply related [flat|nested] 3+ messages in thread* RE: [PATCH] v4l/tvp514x: try_count reaches 0, not -1
2009-02-09 21:57 [PATCH] v4l/tvp514x: try_count reaches 0, not -1 Roel Kluin
@ 2009-02-10 4:18 ` Hiremath, Vaibhav
2009-02-10 9:20 ` Roel Kluin
1 sibling, 0 replies; 3+ messages in thread
From: Hiremath, Vaibhav @ 2009-02-10 4:18 UTC (permalink / raw)
To: Roel Kluin, mchehab@redhat.com
Cc: linux-media@vger.kernel.org, video4linux-list@redhat.com
Thanks,
Vaibhav Hiremath
> -----Original Message-----
> From: Roel Kluin [mailto:roel.kluin@gmail.com]
> Sent: Tuesday, February 10, 2009 3:27 AM
> To: Hiremath, Vaibhav; mchehab@redhat.com
> Cc: linux-media@vger.kernel.org; video4linux-list@redhat.com
> Subject: [PATCH] v4l/tvp514x: try_count reaches 0, not -1
>
> with while (try_count-- > 0) { ... } try_count reaches 0, not -1.
>
[Hiremath, Vaibhav] Please look at the loop,
while (try_count-- > 0) {
Wait till TVP locks the Signal.
}
if ((current_std == STD_INVALID) || (try_count < 0))
return -EINVAL;
The above loop fails to lock the signal, and then the value of try_count will be -1 and not 0. The values 0-4 indicates the signal has been locked, provided that current_std != STD_INVALID.
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> ---
> diff --git a/drivers/media/video/tvp514x.c
> b/drivers/media/video/tvp514x.c
> index 8e23aa5..5f4cbc2 100644
> --- a/drivers/media/video/tvp514x.c
> +++ b/drivers/media/video/tvp514x.c
> @@ -686,7 +686,7 @@ static int ioctl_s_routing(struct
> v4l2_int_device *s,
> break; /* Input detected */
> }
>
> - if ((current_std == STD_INVALID) || (try_count < 0))
> + if ((current_std == STD_INVALID) || (try_count <= 0))
> return -EINVAL;
>
> decoder->current_std = current_std;
[Hiremath, Vaibhav] I believe we don't need this fix here.
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] v4l/tvp514x: try_count reaches 0, not -1
2009-02-09 21:57 [PATCH] v4l/tvp514x: try_count reaches 0, not -1 Roel Kluin
2009-02-10 4:18 ` Hiremath, Vaibhav
@ 2009-02-10 9:20 ` Roel Kluin
1 sibling, 0 replies; 3+ messages in thread
From: Roel Kluin @ 2009-02-10 9:20 UTC (permalink / raw)
To: hvaibhav, mchehab; +Cc: linux-media, video4linux-list
Roel Kluin wrote:
> with while (try_count-- > 0) { ... } try_count reaches 0, not -1.
Sorry but this is bogus, please ignore.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-02-10 9:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-09 21:57 [PATCH] v4l/tvp514x: try_count reaches 0, not -1 Roel Kluin
2009-02-10 4:18 ` Hiremath, Vaibhav
2009-02-10 9:20 ` Roel Kluin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox