Skip to contentSkip to conversation

riscv: ensure cpu_ops_sbi is declared

PATCH In review Conor Dooley 1 participant 2 messages Jul 14, 2022 – Aug 5, 2022 RISC-V

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 riscv: ensure cpu_ops_sbi is declared

Sparse complains that cpu_ops_sbi is used undeclared:
arch/riscv/kernel/cpu_ops_sbi.c:17:29: warning: symbol 'cpu_ops_sbi' was not declared. Should it be static?

Fix the warning by adding cpu_ops_sbi to cpu_ops_sbi.h & including that where used.

---

A trailing > broke the CC list, resending as v2 with just the CC list fixed.

 arch/riscv/include/asm/cpu_ops_sbi.h | 2 ++
 arch/riscv/kernel/cpu_ops.c          | 1 +
 2 files changed, 3 insertions(+)
arch/riscv/include/asm/cpu_ops_sbi.h +2 -0
index 56e4b76d09ff..d6e4665b3195 100644
@@ -10,6 +10,8 @@
 #include <linux/sched.h>
 #include <linux/threads.h>
 
+extern const struct cpu_operations cpu_ops_sbi;
+
 /**
  * struct sbi_hart_boot_data - Hart specific boot used during booting and
  *			       cpu hotplug.
arch/riscv/kernel/cpu_ops.c +1 -0
index 170d07e57721..916b71f5dfb9 100644
@@ -9,6 +9,7 @@
 #include <linux/string.h>
 #include <linux/sched.h>
 #include <asm/cpu_ops.h>
+#include <asm/cpu_ops_sbi.h>
 #include <asm/sbi.h>
 #include <asm/smp.h>
 
Signature · 7 lines
2.36.1


_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
#1 lore raw
Quoted 7 lines · Conor Dooley

Sparse complains that cpu_ops_sbi is used undeclared:
arch/riscv/kernel/cpu_ops_sbi.c:17:29: warning: symbol 'cpu_ops_sbi' was not declared. Should it be static?

Fix the warning by adding cpu_ops_sbi to cpu_ops_sbi.h & including that where used.

Bump for this and the following other sparse fixes:
https://lore.kernel.org/linux-riscv/[email protected]/
https://lore.kernel.org/linux-riscv/[email protected]/
https://lore.kernel.org/linux-riscv/[email protected]/

Thanks,
Conor.

Quoted 27 lines

---

A trailing > broke the CC list, resending as v2 with just the CC list fixed.

 arch/riscv/include/asm/cpu_ops_sbi.h | 2 ++
 arch/riscv/kernel/cpu_ops.c          | 1 +
 2 files changed, 3 insertions(+)
arch/riscv/include/asm/cpu_ops_sbi.h +2 -0
index 56e4b76d09ff..d6e4665b3195 100644
@@ -10,6 +10,8 @@
 #include <linux/sched.h>
 #include <linux/threads.h>
 
+extern const struct cpu_operations cpu_ops_sbi;
+
 /**
  * struct sbi_hart_boot_data - Hart specific boot used during booting and
  *			       cpu hotplug.
arch/riscv/kernel/cpu_ops.c +0 -0
index 170d07e57721..916b71f5dfb9 100644

arch/riscv/kernel/cpu_ops.c line 15

Quoted 7 lines
arch/riscv/kernel/cpu_ops.c +1 -0
@@ -9,6 +9,7 @@
 #include <linux/string.h>
 #include <linux/sched.h>
 #include <asm/cpu_ops.h>
+#include <asm/cpu_ops_sbi.h>
 #include <asm/sbi.h>
 #include <asm/smp.h>
 

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv