diff options
| author | John Stultz <john.stultz@linaro.org> | 2015-09-14 18:05:20 -0700 |
|---|---|---|
| committer | Nikit Sharma <nikitsharma92@gmail.com> | 2018-02-08 00:33:00 +0530 |
| commit | 485600ae5a009975749b88ad25268e63d42745a4 (patch) | |
| tree | 938ebcd4801932f136e7656d896526b824905763 | |
| parent | ec2b6910b366e6cdff0f0baa219de385029d22d9 (diff) | |
clocksource: Fix abs() usage w/ 64bit values
commit 67dfae0cd72fec5cd158b6e5fb1647b7dbe0834c upstream.
This patch fixes one cases where abs() was being used with 64-bit
nanosecond values, where the result may be capped at 32-bits.
This potentially could cause watchdog false negatives on 32-bit
systems, so this patch addresses the issue by using abs64().
Change-Id: I0fea076d3af13221cd43082eb94de4bdcf013275
Signed-off-by: John Stultz <john.stultz@linaro.org>
Cc: Prarit Bhargava <prarit@redhat.com>
Cc: Richard Cochran <richardcochran@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Link: http://lkml.kernel.org/r/1442279124-7309-2-git-send-email-john.stultz@linaro.org
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
[lizf: Backported to 3.4: adjust context]
Signed-off-by: Zefan Li <lizefan@huawei.com>
Signed-off-by: Nikit Sharma <nikitsharma92@gmail.com>
| -rw-r--r-- | kernel/time/clocksource.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c index a4f5988b5e9..ed7d68dfea6 100644 --- a/kernel/time/clocksource.c +++ b/kernel/time/clocksource.c @@ -291,7 +291,7 @@ static void clocksource_watchdog(unsigned long data) continue; /* Check the deviation from the watchdog clocksource. */ - if ((abs(cs_nsec - wd_nsec) > WATCHDOG_THRESHOLD)) { + if ((abs64(cs_nsec - wd_nsec) > WATCHDOG_THRESHOLD)) { clocksource_unstable(cs, cs_nsec - wd_nsec); continue; } |
