[PATCH] hrtimers: Make sure hrtimer_resolution is unsigned int

From: Borislav Petkov
Date: Sat Jun 06 2015 - 05:30:26 EST


From: Borislav Petkov <bp@xxxxxxx>

... in the !CONFIG_HIGH_RES_TIMERS case too. And thus fix warnings like
this one:

net/sched/sch_api.c: In function âpsched_showâ:
net/sched/sch_api.c:1891:6: warning: format â%xâ expects argument of type âunsigned intâ, but argument 6 has type âlong intâ [-Wformat=]
(u32)NSEC_PER_SEC / hrtimer_resolution);

Signed-off-by: Borislav Petkov <bp@xxxxxxx>
Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
---
include/linux/hrtimer.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index 470d876c2eda..3f82a7edc03d 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -309,7 +309,7 @@ extern unsigned int hrtimer_resolution;
# define MONOTONIC_RES_NSEC LOW_RES_NSEC
# define KTIME_MONOTONIC_RES KTIME_LOW_RES

-#define hrtimer_resolution LOW_RES_NSEC
+#define hrtimer_resolution (unsigned int)LOW_RES_NSEC

static inline void hrtimer_peek_ahead_timers(void) { }

--
2.3.5

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