summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhank <pyu@redhat.com>2011-09-20 13:53:39 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2011-11-07 13:47:23 -0800
commit33a7811d55f239dc688867920da9d49d806596d2 (patch)
tree820108b416ef624488c4001e1afb09b36af4857e
parent37ab17c0fed4d31b2ff60f50eb834488f1ce1850 (diff)
downloadlinux-stable-33a7811d55f239dc688867920da9d49d806596d2.tar.gz
linux-stable-33a7811d55f239dc688867920da9d49d806596d2.tar.bz2
linux-stable-33a7811d55f239dc688867920da9d49d806596d2.zip
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 6811f4bfc6e7..284c13d79f4c 100644
--- a/include/linux/jiffies.h
+++ b/include/linux/jiffies.h
@@ -303,7 +303,7 @@ extern void jiffies_to_timespec(const unsigned long jiffies,
extern unsigned long timeval_to_jiffies(const struct timeval *value);
extern void jiffies_to_timeval(const unsigned long jiffies,
struct timeval *value);
-extern clock_t jiffies_to_clock_t(long x);
+extern clock_t jiffies_to_clock_t(unsigned long x);
extern unsigned long clock_t_to_jiffies(unsigned long x);
extern u64 jiffies_64_to_clock_t(u64 x);
extern u64 nsec_to_clock_t(u64 x);
diff --git a/kernel/time.c b/kernel/time.c
index 804798005d19..af1bfb0e770d 100644
--- a/kernel/time.c
+++ b/kernel/time.c
@@ -593,7 +593,7 @@ EXPORT_SYMBOL(jiffies_to_timeval);
/*
* Convert jiffies/jiffies_64 to clock_t and back.
*/
-clock_t jiffies_to_clock_t(long x)
+clock_t jiffies_to_clock_t(unsigned long x)
{
#if (TICK_NSEC % (NSEC_PER_SEC / USER_HZ)) == 0
# if HZ < USER_HZ