lkml.org 
[lkml]   [2014]   [Feb]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[RFC patch 1/5] hrtimer: Always check for HRTIMER_MODE_REL
We have not just HRTIMER_MODE_REL and HRTIMER_MODE_ABS, so a direct
check for mode == HRTIMER_MODE_ABS is not sufficient.

Always check for the HRTIMER_MODE_REL bit.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
kernel/hrtimer.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Index: tip/kernel/hrtimer.c
===================================================================
--- tip.orig/kernel/hrtimer.c
+++ tip/kernel/hrtimer.c
@@ -1186,7 +1186,7 @@ static void __hrtimer_init(struct hrtime

cpu_base = &__raw_get_cpu_var(hrtimer_bases);

- if (clock_id == CLOCK_REALTIME && mode != HRTIMER_MODE_ABS)
+ if (clock_id == CLOCK_REALTIME && (mode & HRTIMER_MODE_REL))
clock_id = CLOCK_MONOTONIC;

base = hrtimer_clockid_to_base(clock_id);
@@ -1620,7 +1620,7 @@ long hrtimer_nanosleep(struct timespec *
goto out;

/* Absolute timers do not update the rmtp value and restart: */
- if (mode == HRTIMER_MODE_ABS) {
+ if (!(mode & HRTIMER_MODE_REL)) {
ret = -ERESTARTNOHAND;
goto out;
}



\
 
 \ /
  Last update: 2014-02-21 19:41    [W:0.110 / U:0.432 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site