clocksource: tegra: fix Sparse warnings
Bo Yan [Fri, 7 Nov 2014 18:27:03 +0000 (10:27 -0800)]
Local variable "ret" is no longer used in tegra210_timer_setup,
remove it.

Function "tegra_read_sched_clock" is not used in ARM64, so
define it conditionally.

Fix typecasting warnings by inserting intermediate stage of casting.
These typecasts are safe.

bug 1566945

Change-Id: I90bd2e49c7df17ce701a410f4ebf5f04d26e7515
Signed-off-by: Bo Yan <byan@nvidia.com>
Reviewed-on: http://git-master/r/596064
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Tested-by: Sachin Nikam <snikam@nvidia.com>

drivers/clocksource/tegra-nvtimers.c
drivers/clocksource/tegra-wakeup-nvtimers.c
drivers/clocksource/tegra210_timer.c

index cb5d0e9..3766600 100644 (file)
@@ -195,10 +195,12 @@ u32 notrace tegra_read_usec_raw(void)
        return timer_readl(TIMERUS_CNTR_1US);
 }
 
+#ifndef CONFIG_ARM64
 static u32 notrace tegra_read_sched_clock(void)
 {
        return timer_readl(TIMERUS_CNTR_1US);
 }
+#endif
 
 static irqreturn_t tegra_timer_interrupt(int irq, void *dev_id)
 {
index e29fe17..d2de074 100644 (file)
@@ -83,7 +83,7 @@ static u32 lp2_wake_timers[] = {
 
 static irqreturn_t tegra_lp2wake_interrupt(int irq, void *dev_id)
 {
-       int cpu = (int)dev_id;
+       int cpu = (int)(uintptr_t)dev_id;
        int base;
 
        base = lp2_wake_timers[cpu];
@@ -171,7 +171,7 @@ fail:
 }
 
 #if defined(CONFIG_PM_SLEEP) && defined(CONFIG_HOTPLUG_CPU)
-static void tegra3_suspend_wake_timer(unsigned int cpu)
+static void tegra3_suspend_wake_timer(int cpu)
 {
        cpumask_clear_cpu(cpu, &wake_timer_ready);
 #ifdef CONFIG_SMP
@@ -184,7 +184,7 @@ static void tegra3_suspend_wake_timer(unsigned int cpu)
 #endif
 }
 
-static void tegra3_unregister_wake_timer(unsigned int cpu)
+static void tegra3_unregister_wake_timer(int cpu)
 {
        tegra3_suspend_wake_timer(cpu);
 
@@ -249,16 +249,16 @@ static int hotplug_notify(struct notifier_block *self,
 {
        switch (action) {
        case CPU_ONLINE:
-               tegra3_register_wake_timer((unsigned int)cpu);
+               tegra3_register_wake_timer((unsigned int)(uintptr_t)cpu);
                break;
        case CPU_ONLINE_FROZEN:
-               tegra3_resume_wake_timer((unsigned int)cpu);
+               tegra3_resume_wake_timer((unsigned int)(uintptr_t)cpu);
                break;
        case CPU_DOWN_PREPARE:
-               tegra3_unregister_wake_timer((unsigned int)cpu);
+               tegra3_unregister_wake_timer((int)(uintptr_t)cpu);
                break;
        case CPU_DOWN_PREPARE_FROZEN:
-               tegra3_suspend_wake_timer((unsigned int)cpu);
+               tegra3_suspend_wake_timer((int)(uintptr_t)cpu);
                break;
        default:
                break;
index 376a7fb..0a307d9 100644 (file)
@@ -122,7 +122,6 @@ static irqreturn_t tegra210_timer_isr(int irq, void *dev_id)
 static void tegra210_timer_setup(struct tegra210_clockevent *tevt)
 {
        int cpu = smp_processor_id();
-       int ret;
 
        clockevents_config_and_register(&tevt->evt, tegra210_timer_freq,
                                        1, /* min */