From: Chris Wright Date: Wed, 1 Feb 2006 03:10:23 +0000 (-0800) Subject: [PATCH] Make sure to always check upper bits of tv_nsec in timespec_valid. X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=bd3f8f2b12bcf4ea25c89b84adeaafad232662c8;p=deliverable%2Flinux.git [PATCH] Make sure to always check upper bits of tv_nsec in timespec_valid. Signed-off-by: Chris Wright Signed-off-by: Linus Torvalds --- diff --git a/include/linux/time.h b/include/linux/time.h index 614dd8465839..7b4dc36532bb 100644 --- a/include/linux/time.h +++ b/include/linux/time.h @@ -48,7 +48,7 @@ extern void set_normalized_timespec(struct timespec *ts, time_t sec, long nsec); * Returns true if the timespec is norm, false if denorm: */ #define timespec_valid(ts) \ - (((ts)->tv_sec >= 0) && (((unsigned) (ts)->tv_nsec) < NSEC_PER_SEC)) + (((ts)->tv_sec >= 0) && (((unsigned long) (ts)->tv_nsec) < NSEC_PER_SEC)) /* * 64-bit nanosec type. Large enough to span 292+ years in nanosecond