summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2006-01-10 05:52:29 +0100
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-10 17:01:36 +0100
commit5f82b2b77e66d452c3037cc47f436d2d76fd5f06 (patch)
treec3c5f11d7160fa4651ca1acf5d927a7546c3d725 /kernel
parent[PATCH] hrtimer: coding style and white space cleanup 2 (diff)
downloadlinux-5f82b2b77e66d452c3037cc47f436d2d76fd5f06.tar.xz
linux-5f82b2b77e66d452c3037cc47f436d2d76fd5f06.zip
[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 'kernel')
-rw-r--r--kernel/posix-timers.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/kernel/posix-timers.c b/kernel/posix-timers.c
index 69d5a4b5395b..6b851a1bf4b0 100644
--- a/kernel/posix-timers.c
+++ b/kernel/posix-timers.c
@@ -712,8 +712,7 @@ out:
*/
static int good_timespec(const struct timespec *ts)
{
- if ((!ts) || (ts->tv_sec < 0) ||
- ((unsigned) ts->tv_nsec >= NSEC_PER_SEC))
+ if ((!ts) || !timespec_valid(ts))
return 0;
return 1;
}
@@ -1406,7 +1405,7 @@ sys_clock_nanosleep(const clockid_t which_clock, int flags,
if (copy_from_user(&t, rqtp, sizeof (struct timespec)))
return -EFAULT;
- if ((unsigned) t.tv_nsec >= NSEC_PER_SEC || t.tv_sec < 0)
+ if (!timespec_valid(&t))
return -EINVAL;
/*