diff options
author | Julia Lawall <julia@diku.dk> | 2008-04-16 15:13:15 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-04-24 13:09:40 -0400 |
commit | 168c626cb8f85df17585af99e14403904641c7ac (patch) | |
tree | b3b899a507b76afc2923d4f7d6c1ed995957a4fc /drivers/media/video/ivtv/ivtv-fileops.c | |
parent | 9e05c0f0d84c25f7f576ebc22a9a3a2cf962cc58 (diff) |
V4L/DVB (7591): drivers/media/video: use time_before, time_before_eq, etc
The functions time_before, time_before_eq, time_after, and time_after_eq
are more robust for comparing jiffies against other values.
A simplified version of the semantic patch making this change is as follows:
(http://www.emn.fr/x-info/coccinelle/)
// <smpl>
@ change_compare_np @
expression E;
@@
(
- jiffies <= E
+ time_before_eq(jiffies,E)
|
- jiffies >= E
+ time_after_eq(jiffies,E)
|
- jiffies < E
+ time_before(jiffies,E)
|
- jiffies > E
+ time_after(jiffies,E)
)
@ include depends on change_compare_np @
@@
@ no_include depends on !include && change_compare_np @
@@
#include <linux/...>
+ #include <linux/jiffies.h>
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/ivtv/ivtv-fileops.c')
-rw-r--r-- | drivers/media/video/ivtv/ivtv-fileops.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/media/video/ivtv/ivtv-fileops.c b/drivers/media/video/ivtv/ivtv-fileops.c index d949a81339d5..a7640c49f1d8 100644 --- a/drivers/media/video/ivtv/ivtv-fileops.c +++ b/drivers/media/video/ivtv/ivtv-fileops.c | |||
@@ -219,7 +219,9 @@ static struct ivtv_buffer *ivtv_get_buffer(struct ivtv_stream *s, int non_block, | |||
219 | /* Process pending program info updates and pending VBI data */ | 219 | /* Process pending program info updates and pending VBI data */ |
220 | ivtv_update_pgm_info(itv); | 220 | ivtv_update_pgm_info(itv); |
221 | 221 | ||
222 | if (jiffies - itv->dualwatch_jiffies > msecs_to_jiffies(1000)) { | 222 | if (time_after(jiffies, |
223 | itv->dualwatch_jiffies + | ||
224 | msecs_to_jiffies(1000))) { | ||
223 | itv->dualwatch_jiffies = jiffies; | 225 | itv->dualwatch_jiffies = jiffies; |
224 | ivtv_dualwatch(itv); | 226 | ivtv_dualwatch(itv); |
225 | } | 227 | } |