Skip to content

Commit

Permalink
RISC-V: Declare cpu_ops_spinwait in <asm/cpu_ops.h>
Browse files Browse the repository at this point in the history
commit da6d212 upstream.

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]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
bjdooks-sifive authored and Sasha Levin committed Aug 17, 2022
1 parent 6ad2567 commit b1f7f1a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 1 addition & 0 deletions arch/riscv/include/asm/cpu_ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ struct cpu_operations {
#endif
};

extern const struct cpu_operations cpu_ops_spinwait;
extern const struct cpu_operations *cpu_ops[NR_CPUS];
void __init cpu_set_ops(int cpu);

Expand Down
4 changes: 1 addition & 3 deletions arch/riscv/kernel/cpu_ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
const struct cpu_operations *cpu_ops[NR_CPUS] __ro_after_init;

extern const struct cpu_operations cpu_ops_sbi;
#ifdef CONFIG_RISCV_BOOT_SPINWAIT
extern const struct cpu_operations cpu_ops_spinwait;
#else
#ifndef CONFIG_RISCV_BOOT_SPINWAIT
const struct cpu_operations cpu_ops_spinwait = {
.name = "",
.cpu_prepare = NULL,
Expand Down

0 comments on commit b1f7f1a

Please sign in to comment.