Skip to contentSkip to conversation

hrtimers: Make sure hrtimer_resolution is unsigned int

PATCH New Borislav Petkov 2 participants 2 messages Jun 6, 2015 – Jun 8, 2015 High-resolution timers, timer wheel, clockevents

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hrtimers: Make sure hrtimer_resolution is unsigned int

From: Borislav Petkov <[email protected]>

... 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);
---
 include/linux/hrtimer.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/hrtimer.h +1 -1
index 470d876c2eda..3f82a7edc03d 100644
@@ -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) { }
 
Signature · 1 line
2.3.5
#1 lore raw
hrtimers: Make sure hrtimer_resolution is unsigned int
Commit-ID:  d711b8b30c803b1b2aedf6a3474758798078f9e1
Gitweb:     http://git.kernel.org/tip/d711b8b30c803b1b2aedf6a3474758798078f9e1
Author:     Borislav Petkov <[email protected]>
AuthorDate: Sat, 6 Jun 2015 11:30:00 +0200
Committer:  Thomas Gleixner <[email protected]>
CommitDate: Mon, 8 Jun 2015 15:46:06 +0200

hrtimers: Make sure hrtimer_resolution is unsigned int

... 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);
---
 include/linux/hrtimer.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/hrtimer.h +1 -1
index 470d876..3f82a7e 100644
@@ -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) { }