aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2006-01-09 23:52:29 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-10 11:01:36 -0500
commit5f82b2b77e66d452c3037cc47f436d2d76fd5f06 (patch)
treec3c5f11d7160fa4651ca1acf5d927a7546c3d725 /include
parent2a698971941bf5e6ebe96275f7d5318b2cf91ccf (diff)
[PATCH] hrtimer: create and use timespec_valid macro
add timespec_valid(ts) [returns false if the timespec is denorm] Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/time.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/time.h b/include/linux/time.h
index 4d49cabb9b47..64e797464589 100644
--- a/include/linux/time.h
+++ b/include/linux/time.h
@@ -44,6 +44,12 @@ extern unsigned long mktime(const unsigned int year, const unsigned int mon,
44 44
45extern void set_normalized_timespec(struct timespec *ts, time_t sec, long nsec); 45extern void set_normalized_timespec(struct timespec *ts, time_t sec, long nsec);
46 46
47/*
48 * Returns true if the timespec is norm, false if denorm:
49 */
50#define timespec_valid(ts) \
51 (((ts)->tv_sec >= 0) && (((unsigned) (ts)->tv_nsec) < NSEC_PER_SEC))
52
47extern struct timespec xtime; 53extern struct timespec xtime;
48extern struct timespec wall_to_monotonic; 54extern struct timespec wall_to_monotonic;
49extern seqlock_t xtime_lock; 55extern seqlock_t xtime_lock;