aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel/smp-cps.c
diff options
context:
space:
mode:
authorMarkos Chandras <markos.chandras@imgtec.com>2015-07-01 04:13:28 -0400
committerRalf Baechle <ralf@linux-mips.org>2015-07-09 05:12:57 -0400
commitfd5ed3066bb2f47814fe53cdc56d11a678551ae1 (patch)
treef76e6ab054148c7d6de8b801abeedf32d081c618 /arch/mips/kernel/smp-cps.c
parent143fefc8f315cd10e046e6860913c421c3385cb1 (diff)
MIPS: kernel: smp-cps: Fix 64-bit compatibility errors due to pointer casting
Commit 1d8f1f5a780a ("MIPS: smp-cps: hotplug support") added hotplug support in the SMP/CPS implementation but it introduced a few build problems on 64-bit kernels due to pointer being casted to and from 'int' C types. We fix this problem by using 'unsigned long' instead which should match the size of the pointers in 32/64-bit kernels. Finally, we fix the comment since the CM base address is loaded to v1($3) instead of v0. Fixes the following build problems: arch/mips/kernel/smp-cps.c: In function 'wait_for_sibling_halt': arch/mips/kernel/smp-cps.c:366:17: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] [...] arch/mips/kernel/smp-cps.c: In function 'cps_cpu_die': arch/mips/kernel/smp-cps.c:427:13: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] cc1: all warnings being treated as errors Fixes: 1d8f1f5a780a ("MIPS: smp-cps: hotplug support") Cc: <stable@vger.kernel.org> # 3.16+ Reviewed-by: Paul Burton <paul.burton@imgtec.com> Signed-off-by: Markos Chandras <markos.chandras@imgtec.com> Cc: linux-mips@linux-mips.org Cc: stable@vger.kernel.org Patchwork: https://patchwork.linux-mips.org/patch/10586/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel/smp-cps.c')
-rw-r--r--arch/mips/kernel/smp-cps.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/mips/kernel/smp-cps.c b/arch/mips/kernel/smp-cps.c
index 4251d390b5b6..c88937745b4e 100644
--- a/arch/mips/kernel/smp-cps.c
+++ b/arch/mips/kernel/smp-cps.c
@@ -133,7 +133,7 @@ static void __init cps_prepare_cpus(unsigned int max_cpus)
133 /* 133 /*
134 * Patch the start of mips_cps_core_entry to provide: 134 * Patch the start of mips_cps_core_entry to provide:
135 * 135 *
136 * v0 = CM base address 136 * v1 = CM base address
137 * s0 = kseg0 CCA 137 * s0 = kseg0 CCA
138 */ 138 */
139 entry_code = (u32 *)&mips_cps_core_entry; 139 entry_code = (u32 *)&mips_cps_core_entry;
@@ -369,7 +369,7 @@ void play_dead(void)
369 369
370static void wait_for_sibling_halt(void *ptr_cpu) 370static void wait_for_sibling_halt(void *ptr_cpu)
371{ 371{
372 unsigned cpu = (unsigned)ptr_cpu; 372 unsigned cpu = (unsigned long)ptr_cpu;
373 unsigned vpe_id = cpu_vpe_id(&cpu_data[cpu]); 373 unsigned vpe_id = cpu_vpe_id(&cpu_data[cpu]);
374 unsigned halted; 374 unsigned halted;
375 unsigned long flags; 375 unsigned long flags;
@@ -430,7 +430,7 @@ static void cps_cpu_die(unsigned int cpu)
430 */ 430 */
431 err = smp_call_function_single(cpu_death_sibling, 431 err = smp_call_function_single(cpu_death_sibling,
432 wait_for_sibling_halt, 432 wait_for_sibling_halt,
433 (void *)cpu, 1); 433 (void *)(unsigned long)cpu, 1);
434 if (err) 434 if (err)
435 panic("Failed to call remote sibling CPU\n"); 435 panic("Failed to call remote sibling CPU\n");
436 } 436 }