Skip to content

Commit da6d212

Browse files
bjdooks-sifivepalmer-dabbelt
authored andcommitted
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: Ben Dooks <[email protected]> Link: https://lore.kernel.org/r/[email protected] [Palmer: Drop the extern from cpu_ops.c] Fixes: 2ffc48f ("RISC-V: Move spinwait booting method to its own config") Cc: [email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent a208acf commit da6d212

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

arch/riscv/include/asm/cpu_ops.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ struct cpu_operations {
3838
#endif
3939
};
4040

41+
extern const struct cpu_operations cpu_ops_spinwait;
4142
extern const struct cpu_operations *cpu_ops[NR_CPUS];
4243
void __init cpu_set_ops(int cpu);
4344

arch/riscv/kernel/cpu_ops.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@
1515
const struct cpu_operations *cpu_ops[NR_CPUS] __ro_after_init;
1616

1717
extern const struct cpu_operations cpu_ops_sbi;
18-
#ifdef CONFIG_RISCV_BOOT_SPINWAIT
19-
extern const struct cpu_operations cpu_ops_spinwait;
20-
#else
18+
#ifndef CONFIG_RISCV_BOOT_SPINWAIT
2119
const struct cpu_operations cpu_ops_spinwait = {
2220
.name = "",
2321
.cpu_prepare = NULL,

0 commit comments

Comments
 (0)