diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2009-11-11 09:05:25 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2009-11-13 14:46:23 -0500 |
commit | 23af368e9a904f59256c27d371ce223d6cee0430 (patch) | |
tree | 8d38ff75d731abc1182a331c2955b9c3c7025533 | |
parent | 3c5d92a0cfb5103c0d5ab74d4ae6373d3af38148 (diff) |
clockevents: Use u32 for mult and shift factors
The mult and shift factors of clock events differ in their data type
from those of clock sources for no reason. u32 is sufficient for
both. shift is always <= 32 and mult is limited to 2^32-1 to avoid
64bit multiplication overflows in the conversion.
Preparatory patch for a generic mult/shift factor calculation
function.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Mikael Pettersson <mikpe@it.uu.se>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Acked-by: Linus Walleij <linus.walleij@stericsson.com>
Cc: John Stultz <johnstul@us.ibm.com>
LKML-Reference: <20091111134229.725664788@linutronix.de>
-rw-r--r-- | include/linux/clockchips.h | 4 | ||||
-rw-r--r-- | kernel/time/timer_list.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h index 3a1dbba4d3ae..3b5841016276 100644 --- a/include/linux/clockchips.h +++ b/include/linux/clockchips.h | |||
@@ -79,8 +79,8 @@ struct clock_event_device { | |||
79 | unsigned int features; | 79 | unsigned int features; |
80 | unsigned long max_delta_ns; | 80 | unsigned long max_delta_ns; |
81 | unsigned long min_delta_ns; | 81 | unsigned long min_delta_ns; |
82 | unsigned long mult; | 82 | u32 mult; |
83 | int shift; | 83 | u32 shift; |
84 | int rating; | 84 | int rating; |
85 | int irq; | 85 | int irq; |
86 | const struct cpumask *cpumask; | 86 | const struct cpumask *cpumask; |
diff --git a/kernel/time/timer_list.c b/kernel/time/timer_list.c index 1b5b7aa2fdfd..fa00da108a14 100644 --- a/kernel/time/timer_list.c +++ b/kernel/time/timer_list.c | |||
@@ -206,8 +206,8 @@ print_tickdevice(struct seq_file *m, struct tick_device *td, int cpu) | |||
206 | SEQ_printf(m, "%s\n", dev->name); | 206 | SEQ_printf(m, "%s\n", dev->name); |
207 | SEQ_printf(m, " max_delta_ns: %lu\n", dev->max_delta_ns); | 207 | SEQ_printf(m, " max_delta_ns: %lu\n", dev->max_delta_ns); |
208 | SEQ_printf(m, " min_delta_ns: %lu\n", dev->min_delta_ns); | 208 | SEQ_printf(m, " min_delta_ns: %lu\n", dev->min_delta_ns); |
209 | SEQ_printf(m, " mult: %lu\n", dev->mult); | 209 | SEQ_printf(m, " mult: %u\n", dev->mult); |
210 | SEQ_printf(m, " shift: %d\n", dev->shift); | 210 | SEQ_printf(m, " shift: %u\n", dev->shift); |
211 | SEQ_printf(m, " mode: %d\n", dev->mode); | 211 | SEQ_printf(m, " mode: %d\n", dev->mode); |
212 | SEQ_printf(m, " next_event: %Ld nsecs\n", | 212 | SEQ_printf(m, " next_event: %Ld nsecs\n", |
213 | (unsigned long long) ktime_to_ns(dev->next_event)); | 213 | (unsigned long long) ktime_to_ns(dev->next_event)); |