mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
[PATCH] hrtimer: create and use timespec_valid macro
add timespec_valid(ts) [returns false if the timespec is denorm] Signed-off-by: Thomas Gleixner <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
2a69897194
commit
5f82b2b77e
2 changed files with 8 additions and 3 deletions
|
|
@ -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;
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in a new issue