aboutsummaryrefslogtreecommitdiff
path: root/drivers/clocksource
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/clocksource')
-rw-r--r--drivers/clocksource/acpi_pm.c17
-rw-r--r--drivers/clocksource/arm_generic.c6
-rw-r--r--drivers/clocksource/i8253.c2
3 files changed, 12 insertions, 13 deletions
diff --git a/drivers/clocksource/acpi_pm.c b/drivers/clocksource/acpi_pm.c
index 6b5cf02c35c..5d1b9268bca 100644
--- a/drivers/clocksource/acpi_pm.c
+++ b/drivers/clocksource/acpi_pm.c
@@ -233,16 +233,15 @@ fs_initcall(init_acpi_pm_clocksource);
*/
static int __init parse_pmtmr(char *arg)
{
- unsigned long base;
+ unsigned int base;
+ int ret;
- if (strict_strtoul(arg, 16, &base))
- return -EINVAL;
-#ifdef CONFIG_X86_64
- if (base > UINT_MAX)
- return -ERANGE;
-#endif
- printk(KERN_INFO "PMTMR IOPort override: 0x%04x -> 0x%04lx\n",
- pmtmr_ioport, base);
+ ret = kstrtouint(arg, 16, &base);
+ if (ret)
+ return ret;
+
+ pr_info("PMTMR IOPort override: 0x%04x -> 0x%04x\n", pmtmr_ioport,
+ base);
pmtmr_ioport = base;
return 1;
diff --git a/drivers/clocksource/arm_generic.c b/drivers/clocksource/arm_generic.c
index df5d7e8e5b8..8ae1a61523f 100644
--- a/drivers/clocksource/arm_generic.c
+++ b/drivers/clocksource/arm_generic.c
@@ -127,7 +127,7 @@ static void __init arch_timer_calibrate(void)
/* Cache the sched_clock multiplier to save a divide in the hot path. */
- sched_clock_mult = NSEC_PER_SEC / arch_timer_rate;
+ sched_clock_mult = DIV_ROUND_CLOSEST(NSEC_PER_SEC, arch_timer_rate);
pr_info("Architected local timer running at %u.%02uMHz.\n",
arch_timer_rate / 1000000, (arch_timer_rate / 10000) % 100);
@@ -221,10 +221,10 @@ int __init arm_generic_timer_init(void)
clocksource_register_hz(&clocksource_counter, arch_timer_rate);
/* Calibrate the delay loop directly */
- lpj_fine = arch_timer_rate / HZ;
+ lpj_fine = DIV_ROUND_CLOSEST(arch_timer_rate, HZ);
/* Immediately configure the timer on the boot CPU */
- arch_timer_setup(per_cpu_ptr(&arch_timer_evt, smp_processor_id()));
+ arch_timer_setup(this_cpu_ptr(&arch_timer_evt));
register_cpu_notifier(&arch_timer_cpu_nb);
diff --git a/drivers/clocksource/i8253.c b/drivers/clocksource/i8253.c
index e7cab2da910..14ee3efcc40 100644
--- a/drivers/clocksource/i8253.c
+++ b/drivers/clocksource/i8253.c
@@ -35,7 +35,7 @@ static cycle_t i8253_read(struct clocksource *cs)
raw_spin_lock_irqsave(&i8253_lock, flags);
/*
- * Although our caller may have the read side of xtime_lock,
+ * Although our caller may have the read side of jiffies_lock,
* this is now a seqlock, and we are cheating in this routine
* by having side effects on state that we cannot undo if
* there is a collision on the seqlock and our caller has to