[patch 47/55] hangcheck-timer: Use ktime_get_raw_ns()

From: Thomas Gleixner
Date: Fri Jul 11 2014 - 09:49:02 EST


Use the nanoseconds based interface instead of converting timespecs.

Signed-off-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Cc: Arnd Bergmann <arnd@xxxxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
drivers/char/hangcheck-timer.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)

Index: tip/drivers/char/hangcheck-timer.c
===================================================================
--- tip.orig/drivers/char/hangcheck-timer.c
+++ tip/drivers/char/hangcheck-timer.c
@@ -49,7 +49,7 @@
#include <asm/uaccess.h>
#include <linux/sysrq.h>
#include <linux/timer.h>
-#include <linux/time.h>
+#include <linux/hrtimer.h>

#define VERSION_STR "0.9.1"

@@ -129,9 +129,7 @@ extern unsigned long long monotonic_cloc
#else
static inline unsigned long long monotonic_clock(void)
{
- struct timespec ts;
- getrawmonotonic(&ts);
- return timespec_to_ns(&ts);
+ return ktime_get_raw_ns();
}
#endif /* HAVE_MONOTONIC */

@@ -186,9 +184,9 @@ static int __init hangcheck_init(void)
printk("Hangcheck: starting hangcheck timer %s (tick is %d seconds, margin is %d seconds).\n",
VERSION_STR, hangcheck_tick, hangcheck_margin);
#if defined (HAVE_MONOTONIC)
- printk("Hangcheck: Using monotonic_clock().\n");
+ printk("Hangcheck: Using monotonic clock\n");
#else
- printk("Hangcheck: Using getrawmonotonic().\n");
+ printk("Hangcheck: Using raw monotonic clock.\n");
#endif /* HAVE_MONOTONIC */
hangcheck_tsc_margin =
(unsigned long long)(hangcheck_margin + hangcheck_tick);


--
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/