aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhank <pyu@redhat.com>2011-09-20 16:53:39 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2011-11-11 12:35:52 -0500
commitc7f65094f7e2b8463a7c002e967e78db8f30468a (patch)
treeda95910f073769273a1708fccc566e18337d0752
parent40b3c4dc2c6c44972323be3a1ebd62c4fe35fac0 (diff)
time: Change jiffies_to_clock_t() argument type to unsigned long
commit cbbc719fccdb8cbd87350a05c0d33167c9b79365 upstream. The parameter's origin type is long. On an i386 architecture, it can easily be larger than 0x80000000, causing this function to convert it to a sign-extended u64 type. Change the type to unsigned long so we get the correct result. Signed-off-by: hank <pyu@redhat.com> Cc: John Stultz <john.stultz@linaro.org> [ build fix ] Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--include/linux/jiffies.h2
-rw-r--r--kernel/time.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h
index f97672a36fa..265e2c3cbd1 100644
--- a/include/linux/jiffies.h
+++ b/include/linux/jiffies.h
@@ -303,7 +303,7 @@ extern void jiffies_to_timespec(const unsigned long jiffies,
303extern unsigned long timeval_to_jiffies(const struct timeval *value); 303extern unsigned long timeval_to_jiffies(const struct timeval *value);
304extern void jiffies_to_timeval(const unsigned long jiffies, 304extern void jiffies_to_timeval(const unsigned long jiffies,
305 struct timeval *value); 305 struct timeval *value);
306extern clock_t jiffies_to_clock_t(long x); 306extern clock_t jiffies_to_clock_t(unsigned long x);
307extern unsigned long clock_t_to_jiffies(unsigned long x); 307extern unsigned long clock_t_to_jiffies(unsigned long x);
308extern u64 jiffies_64_to_clock_t(u64 x); 308extern u64 jiffies_64_to_clock_t(u64 x);
309extern u64 nsec_to_clock_t(u64 x); 309extern u64 nsec_to_clock_t(u64 x);
diff --git a/kernel/time.c b/kernel/time.c
index 8e8dc6d705c..d7760621452 100644
--- a/kernel/time.c
+++ b/kernel/time.c
@@ -575,7 +575,7 @@ EXPORT_SYMBOL(jiffies_to_timeval);
575/* 575/*
576 * Convert jiffies/jiffies_64 to clock_t and back. 576 * Convert jiffies/jiffies_64 to clock_t and back.
577 */ 577 */
578clock_t jiffies_to_clock_t(long x) 578clock_t jiffies_to_clock_t(unsigned long x)
579{ 579{
580#if (TICK_NSEC % (NSEC_PER_SEC / USER_HZ)) == 0 580#if (TICK_NSEC % (NSEC_PER_SEC / USER_HZ)) == 0
581# if HZ < USER_HZ 581# if HZ < USER_HZ