From 3f34d024c12e49fbce4009d094ae1d287084e511 Mon Sep 17 00:00:00 2001 From: Dave Young Date: Fri, 18 Apr 2008 13:38:57 -0700 Subject: [PATCH] jiffies: add time_is_after_jiffies and others which compare with jiffies Most of time_after like macros usages just compare jiffies and another number, so here add some time_is_* macros for convenience. Signed-off-by: Dave Young Cc: Alan Cox Signed-off-by: Andrew Morton Signed-off-by: Thomas Gleixner --- include/linux/jiffies.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h index e0b5b68..e377e34 100644 --- a/include/linux/jiffies.h +++ b/include/linux/jiffies.h @@ -135,6 +135,22 @@ static inline u64 get_jiffies_64(void) #define time_before_eq64(a,b) time_after_eq64(b,a) /* + * These four macros compare jiffies and 'a' for convenience. + */ + +/* time_is_before_jiffies(a) return true if a is before jiffies */ +#define time_is_before_jiffies(a) time_after(jiffies, a) + +/* time_is_after_jiffies(a) return true if a is after jiffies */ +#define time_is_after_jiffies(a) time_before(jiffies, a) + +/* time_is_before_eq_jiffies(a) return true if a is before or equal to jiffies*/ +#define time_is_before_eq_jiffies(a) time_after_eq(jiffies, a) + +/* time_is_after_eq_jiffies(a) return true if a is after or equal to jiffies*/ +#define time_is_after_eq_jiffies(a) time_before_eq(jiffies, a) + +/* * Have the 32 bit jiffies value wrap 5 minutes after boot * so jiffies wrap bugs show up earlier. */ -- 2.7.4