RISC-V: Fix build warning for smpboot.c
authorAtish Patra <atish.patra@wdc.com>
Thu, 30 Jul 2020 00:25:35 +0000 (17:25 -0700)
committerPalmer Dabbelt <palmerdabbelt@google.com>
Tue, 4 Aug 2020 22:02:42 +0000 (15:02 -0700)
The following warnings are reported by kbuild with W=1.

>> arch/riscv/kernel/smpboot.c:109:5: warning: no previous prototype for
'start_secondary_cpu' [-Wmissing-prototypes]
     109 | int start_secondary_cpu(int cpu, struct task_struct *tidle)
         |     ^~~~~~~~~~~~~~~~~~~
   arch/riscv/kernel/smpboot.c:146:34: warning: no previous prototype for
'smp_callin' [-Wmissing-prototypes]
     146 | asmlinkage __visible void __init smp_callin(void)
         |                                  ^~~~~~~~~~

Fix the warnings by marking the local functions static and adding the prototype
for the global function.

Signed-off-by: Atish Patra <atish.patra@wdc.com>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
arch/riscv/include/asm/smp.h
arch/riscv/kernel/smpboot.c

index 40bb1c15a731f3b66d23e3189bd8ee2a05c71a57..6dfd2a1446d56c53041a8c34db003683a3d680b5 100644 (file)
@@ -40,6 +40,9 @@ void arch_send_call_function_single_ipi(int cpu);
 int riscv_hartid_to_cpuid(int hartid);
 void riscv_cpuid_to_hartid_mask(const struct cpumask *in, struct cpumask *out);
 
+/* Secondary hart entry */
+asmlinkage void smp_callin(void);
+
 /*
  * Obtains the hart ID of the currently executing task.  This relies on
  * THREAD_INFO_IN_TASK, but we define that unconditionally.
index 47404d4ad7219c3fca9d2c7743c7ad40b3782238..356825a57551c1cb7e97cf89ea80db1be129eb95 100644 (file)
@@ -106,7 +106,7 @@ void __init setup_smp(void)
        }
 }
 
-int start_secondary_cpu(int cpu, struct task_struct *tidle)
+static int start_secondary_cpu(int cpu, struct task_struct *tidle)
 {
        if (cpu_ops[cpu]->cpu_start)
                return cpu_ops[cpu]->cpu_start(cpu, tidle);