summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/ivtv/ivtv-fileops.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2008-04-16 13:13:15 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-04-16 13:13:15 -0300
commit21e7b71d43a101d79253fd292136ba2c9c847c8e (patch)
treef6430099b7c3fe7c450df0db8309e99d6f0502ed /linux/drivers/media/video/ivtv/ivtv-fileops.c
parent4ff89e84d541267e09b5d57533bd762e6dbf3764 (diff)
downloadmediapointer-dvb-s2-21e7b71d43a101d79253fd292136ba2c9c847c8e.tar.gz
mediapointer-dvb-s2-21e7b71d43a101d79253fd292136ba2c9c847c8e.tar.bz2
drivers/media/video: use time_before, time_before_eq, etc
From: Julia Lawall <julia@diku.dk> 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 'linux/drivers/media/video/ivtv/ivtv-fileops.c')
-rw-r--r--linux/drivers/media/video/ivtv/ivtv-fileops.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/linux/drivers/media/video/ivtv/ivtv-fileops.c b/linux/drivers/media/video/ivtv/ivtv-fileops.c
index d949a8133..a7640c49f 100644
--- a/linux/drivers/media/video/ivtv/ivtv-fileops.c
+++ b/linux/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,
/* Process pending program info updates and pending VBI data */
ivtv_update_pgm_info(itv);
- if (jiffies - itv->dualwatch_jiffies > msecs_to_jiffies(1000)) {
+ if (time_after(jiffies,
+ itv->dualwatch_jiffies +
+ msecs_to_jiffies(1000))) {
itv->dualwatch_jiffies = jiffies;
ivtv_dualwatch(itv);
}