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-streams.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-streams.c')
-rw-r--r-- | drivers/media/video/ivtv/ivtv-streams.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/media/video/ivtv/ivtv-streams.c b/drivers/media/video/ivtv/ivtv-streams.c index 24d98ecf35ad..4ab8d36831ba 100644 --- a/drivers/media/video/ivtv/ivtv-streams.c +++ b/drivers/media/video/ivtv/ivtv-streams.c | |||
@@ -768,7 +768,8 @@ int ivtv_stop_v4l2_encode_stream(struct ivtv_stream *s, int gop_end) | |||
768 | 768 | ||
769 | /* wait 2s for EOS interrupt */ | 769 | /* wait 2s for EOS interrupt */ |
770 | while (!test_bit(IVTV_F_I_EOS, &itv->i_flags) && | 770 | while (!test_bit(IVTV_F_I_EOS, &itv->i_flags) && |
771 | jiffies < then + msecs_to_jiffies (2000)) { | 771 | time_before(jiffies, |
772 | then + msecs_to_jiffies(2000))) { | ||
772 | schedule_timeout(msecs_to_jiffies(10)); | 773 | schedule_timeout(msecs_to_jiffies(10)); |
773 | } | 774 | } |
774 | 775 | ||