Commit da6d2128 authored by Ben Dooks's avatar Ben Dooks Committed by Palmer Dabbelt

RISC-V: Declare cpu_ops_spinwait in <asm/cpu_ops.h>

The cpu_ops_spinwait is used in a couple of places in arch/riscv
and is causing a sparse warning due to no declaration. Add this
to <asm/cpu_ops.h> with the others to fix the following:

arch/riscv/kernel/cpu_ops_spinwait.c:16:29: warning: symbol 'cpu_ops_spinwait' was not declared. Should it be static?
Signed-off-by: default avatarBen Dooks <ben.dooks@sifive.com>
Link: https://lore.kernel.org/r/20220714071811.187491-1-ben.dooks@sifive.com
[Palmer: Drop the extern from cpu_ops.c]
Fixes: 2ffc48fc ("RISC-V: Move spinwait booting method to its own config")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
parent a208acf0
...@@ -38,6 +38,7 @@ struct cpu_operations { ...@@ -38,6 +38,7 @@ struct cpu_operations {
#endif #endif
}; };
extern const struct cpu_operations cpu_ops_spinwait;
extern const struct cpu_operations *cpu_ops[NR_CPUS]; extern const struct cpu_operations *cpu_ops[NR_CPUS];
void __init cpu_set_ops(int cpu); void __init cpu_set_ops(int cpu);
......
...@@ -15,9 +15,7 @@ ...@@ -15,9 +15,7 @@
const struct cpu_operations *cpu_ops[NR_CPUS] __ro_after_init; const struct cpu_operations *cpu_ops[NR_CPUS] __ro_after_init;
extern const struct cpu_operations cpu_ops_sbi; extern const struct cpu_operations cpu_ops_sbi;
#ifdef CONFIG_RISCV_BOOT_SPINWAIT #ifndef CONFIG_RISCV_BOOT_SPINWAIT
extern const struct cpu_operations cpu_ops_spinwait;
#else
const struct cpu_operations cpu_ops_spinwait = { const struct cpu_operations cpu_ops_spinwait = {
.name = "", .name = "",
.cpu_prepare = NULL, .cpu_prepare = NULL,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment