Skip to contentSkip to conversation

v4l/tvp514x: try_count reaches 0, not -1

PATCH In review Roel Kluin 2 participants 3 messages Feb 9, 2009 – Feb 10, 2009 Media (V4L/DVB)

lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 v4l/tvp514x: try_count reaches 0, not -1

with while (try_count-- > 0) { ... } try_count reaches 0, not -1.

---

drivers/media/video/tvp514x.c +1 -1
index 8e23aa5..5f4cbc2 100644
@@ -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;
#1 lore raw

Thanks,
Vaibhav Hiremath

Quoted 9 lines

-----Original Message-----
From: Roel Kluin [mailto:[email protected]]
Sent: Tuesday, February 10, 2009 3:27 AM
To: Hiremath, Vaibhav; [email protected]
Cc: [email protected]; [email protected]
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.

Quoted 16 lines

---

drivers/media/video/tvp514x.c +1 -1
index 8e23aa5..5f4cbc2 100644
@@ -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;
 
Quoted 1 line

decoder->current_std = current_std;

[Hiremath, Vaibhav] I believe we don't need this fix here.

author
#2 lore raw
In reply to Roel Kluin
Quoted 1 line · Roel Kluin

with while (try_count-- > 0) { ... } try_count reaches 0, not -1.

Sorry but this is bogus, please ignore.