[RFC patch 1/5] hrtimer: Always check for HRTIMER_MODE_REL

From: Thomas Gleixner
Date: Fri Feb 21 2014 - 12:56:51 EST


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@xxxxxxxxxxxxx>
---
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;
}


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/