aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/time
diff options
context:
space:
mode:
authorJohn Stultz <john.stultz@linaro.org>2012-07-13 01:21:52 -0400
committerThomas Gleixner <tglx@linutronix.de>2012-07-15 04:39:05 -0400
commitfee84c43e6afc42295ae8058cbbef9ea5633926c (patch)
tree4cbc2c945aee74e15e1a08bc86a66c697169b55f /kernel/time
parent42e71e81f5bb5125ca7c194b5ccf1c93511ff8fb (diff)
time: Explicitly use u32 instead of int for shift values
Ingo noted that using a u32 instead of int for shift values would be better to make sure the compiler doesn't unnecessarily use complex signed arithmetic. Signed-off-by: John Stultz <john.stultz@linaro.org> Reviewed-by: Ingo Molnar <mingo@kernel.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Richard Cochran <richardcochran@gmail.com> Cc: Prarit Bhargava <prarit@redhat.com> Link: http://lkml.kernel.org/r/1342156917-25092-4-git-send-email-john.stultz@linaro.org Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/time')
-rw-r--r--kernel/time/timekeeping.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
index c2f12aa87fce..4fd83df0b14d 100644
--- a/kernel/time/timekeeping.c
+++ b/kernel/time/timekeeping.c
@@ -28,7 +28,7 @@ struct timekeeper {
28 /* NTP adjusted clock multiplier */ 28 /* NTP adjusted clock multiplier */
29 u32 mult; 29 u32 mult;
30 /* The shift value of the current clocksource. */ 30 /* The shift value of the current clocksource. */
31 int shift; 31 u32 shift;
32 /* Number of clock cycles in one NTP interval. */ 32 /* Number of clock cycles in one NTP interval. */
33 cycle_t cycle_interval; 33 cycle_t cycle_interval;
34 /* Number of clock shifted nano seconds in one NTP interval. */ 34 /* Number of clock shifted nano seconds in one NTP interval. */
@@ -45,7 +45,7 @@ struct timekeeper {
45 s64 ntp_error; 45 s64 ntp_error;
46 /* Shift conversion between clock shifted nano seconds and 46 /* Shift conversion between clock shifted nano seconds and
47 * ntp shifted nano seconds. */ 47 * ntp shifted nano seconds. */
48 int ntp_error_shift; 48 u32 ntp_error_shift;
49 49
50 /* The current time */ 50 /* The current time */
51 struct timespec xtime; 51 struct timespec xtime;
@@ -960,7 +960,7 @@ static void timekeeping_adjust(s64 offset)
960 * 960 *
961 * Returns the unconsumed cycles. 961 * Returns the unconsumed cycles.
962 */ 962 */
963static cycle_t logarithmic_accumulation(cycle_t offset, int shift) 963static cycle_t logarithmic_accumulation(cycle_t offset, u32 shift)
964{ 964{
965 u64 nsecps = (u64)NSEC_PER_SEC << timekeeper.shift; 965 u64 nsecps = (u64)NSEC_PER_SEC << timekeeper.shift;
966 u64 raw_nsecs; 966 u64 raw_nsecs;