Skip to contentSkip to conversation

RISC-V: cpu_ops_spinwait.c should include head.h

PATCH In review Ben Dooks 3 participants 6 messages Jul 13, 2022 – Aug 11, 2022 RISC-V

lore
Share & tools
lore

Ben Dooks

author
#0 lore raw

PATCH 1/1 RISC-V: cpu_ops_spinwait.c should include head.h

Running sparse shows cpu_ops_spinwait.c is missing two definitions found in head.h, so include it to stop the following warnings:

arch/riscv/kernel/cpu_ops_spinwait.c:15:6: warning: symbol '__cpu_spinwait_stack_pointer' was not declared. Should it be static? arch/riscv/kernel/cpu_ops_spinwait.c:16:6: warning: symbol '__cpu_spinwait_task_pointer' was not declared. Should it be static?

---
 arch/riscv/kernel/cpu_ops_spinwait.c | 2 ++
 1 file changed, 2 insertions(+)
arch/riscv/kernel/cpu_ops_spinwait.c +2 -0
index 346847f6c41c..c662a7cf10a4 100644
@@ -11,6 +11,8 @@
 #include <asm/sbi.h>
 #include <asm/smp.h>
 
+#include "head.h"
+
 const struct cpu_operations cpu_ops_spinwait;
 void *__cpu_spinwait_stack_pointer[NR_CPUS] __section(".data");
 void *__cpu_spinwait_task_pointer[NR_CPUS] __section(".data");
Signature · 7 lines
2.35.1


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

EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe

Running sparse shows cpu_ops_spinwait.c is missing two definitions found in head.h, so include it to stop the following warnings:

arch/riscv/kernel/cpu_ops_spinwait.c:15:6: warning: symbol '__cpu_spinwait_stack_pointer' was not declared. Should it be static? arch/riscv/kernel/cpu_ops_spinwait.c:16:6: warning: symbol '__cpu_spinwait_task_pointer' was not declared. Should it be static?

Hey Ben,
With this applied I still see a:
arch/riscv/kernel/cpu_ops.c:21:29: warning: symbol 'cpu_ops_spinwait' was not declared. Should it be static?

Seems to be in the same ballpack, so maybe you could fix that one too?

FWIW:
# CONFIG_RISCV_BOOT_SPINWAIT is not set
Thanks,
Conor.

Quoted 21 lines
---
  arch/riscv/kernel/cpu_ops_spinwait.c | 2 ++
  1 file changed, 2 insertions(+)
arch/riscv/kernel/cpu_ops_spinwait.c +2 -1
index 346847f6c41c..c662a7cf10a4 100644
@@ -11,6 +11,8 @@
  #include <asm/sbi.h>
  #include <asm/smp.h>
 
+#include "head.h"
+
  const struct cpu_operations cpu_ops_spinwait;
  void *__cpu_spinwait_stack_pointer[NR_CPUS] __section(".data");
  void *__cpu_spinwait_task_pointer[NR_CPUS] __section(".data");
--

2.35.1

Quoted 4 lines

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

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

author
#2 lore raw
Quoted 9 lines · On 14/07/2022 07:33, [email protected] wrote:
Quoted 8 lines · Ben Dooks

EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe

Running sparse shows cpu_ops_spinwait.c is missing two definitions found in head.h, so include it to stop the following warnings:

arch/riscv/kernel/cpu_ops_spinwait.c:15:6: warning: symbol '__cpu_spinwait_stack_pointer' was not declared. Should it be static? arch/riscv/kernel/cpu_ops_spinwait.c:16:6: warning: symbol '__cpu_spinwait_task_pointer' was not declared. Should it be static?

Quoted 7 lines
Quoted 1 line

Hey Ben,
With this applied I still see a:
arch/riscv/kernel/cpu_ops.c:21:29: warning: symbol 'cpu_ops_spinwait' was not declared. Should it be static?

Seems to be in the same ballpack, so maybe you could fix that one too?

I've done that as a new patch in case it needs to be moved. Not sure head.h was the right place nor where it ended up.

Signature · 6 lines
Ben

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
Reviewed-by
#3 lore raw
Quoted 14 lines · Ben Dooks

EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe

Quoted 11 lines · On 14/07/2022 07:33, [email protected] wrote:
Quoted 9 lines · Ben Dooks

EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe

Running sparse shows cpu_ops_spinwait.c is missing two definitions found in head.h, so include it to stop the following warnings:

arch/riscv/kernel/cpu_ops_spinwait.c:15:6: warning: symbol '__cpu_spinwait_stack_pointer' was not declared. Should it be static? arch/riscv/kernel/cpu_ops_spinwait.c:16:6: warning: symbol '__cpu_spinwait_task_pointer' was not declared. Should it be static?

Quoted 8 lines
Quoted 5 lines

Hey Ben,
With this applied I still see a:
arch/riscv/kernel/cpu_ops.c:21:29: warning: symbol 'cpu_ops_spinwait' was not declared. Should it be static?

Seems to be in the same ballpack, so maybe you could fix that one too?

I've done that as a new patch in case it needs to be moved. Not sure head.h was the right place nor where it ended up.

This is a rabbit hole man. I found another one while checking by build logs to check that that one had been fixed. I'll send a patch this time..

For this one:

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

maintainer
#4 lore raw
Quoted 24 lines · On Thu, 14 Jul 2022 00:41:12 PDT (-0700), [email protected] wrote:
Quoted 14 lines · Ben Dooks

EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe

Quoted 11 lines · On 14/07/2022 07:33, [email protected] wrote:
Quoted 9 lines · Ben Dooks

EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe

Running sparse shows cpu_ops_spinwait.c is missing two definitions found in head.h, so include it to stop the following warnings:

arch/riscv/kernel/cpu_ops_spinwait.c:15:6: warning: symbol '__cpu_spinwait_stack_pointer' was not declared. Should it be static? arch/riscv/kernel/cpu_ops_spinwait.c:16:6: warning: symbol '__cpu_spinwait_task_pointer' was not declared. Should it be static?

Quoted 8 lines
Quoted 5 lines

Hey Ben,
With this applied I still see a:
arch/riscv/kernel/cpu_ops.c:21:29: warning: symbol 'cpu_ops_spinwait' was not declared. Should it be static?

Seems to be in the same ballpack, so maybe you could fix that one too?

I've done that as a new patch in case it needs to be moved. Not sure head.h was the right place nor where it ended up.

Quoted 6 lines

This is a rabbit hole man. I found another one while checking by build logs to check that that one had been fixed. I'll send a patch this time..

For this one:

IMO we also need something like this

   diff --git a/arch/riscv/kernel/cpu_ops.c b/arch/riscv/kernel/cpu_ops.c
   index 170d07e57721..f92c0e6eddb1 100644
   --- a/arch/riscv/kernel/cpu_ops.c
   +++ b/arch/riscv/kernel/cpu_ops.c
   @@ -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,

I squashed that in and added a CONFIG_RISCV_BOOT_SPINWAIT=y test, as defconfig is =n now. I'm not seeing these warnings, but it's cleaner this way.

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

maintainer
#5 lore raw
In reply to Ben Dooks
Quoted 16 lines · On Wed, 13 Jul 2022 14:53:06 PDT (-0700), [email protected] wrote:

Running sparse shows cpu_ops_spinwait.c is missing two definitions found in head.h, so include it to stop the following warnings:

arch/riscv/kernel/cpu_ops_spinwait.c:15:6: warning: symbol '__cpu_spinwait_stack_pointer' was not declared. Should it be static? arch/riscv/kernel/cpu_ops_spinwait.c:16:6: warning: symbol '__cpu_spinwait_task_pointer' was not declared. Should it be static?

---
 arch/riscv/kernel/cpu_ops_spinwait.c | 2 ++
 1 file changed, 2 insertions(+)
arch/riscv/kernel/cpu_ops_spinwait.c +0 -0
index 346847f6c41c..c662a7cf10a4 100644

arch/riscv/kernel/cpu_ops_spinwait.c line 18

Quoted 8 lines
arch/riscv/kernel/cpu_ops_spinwait.c +2 -0
@@ -11,6 +11,8 @@
 #include <asm/sbi.h>
 #include <asm/smp.h>
 
+#include "head.h"
+
 const struct cpu_operations cpu_ops_spinwait;
 void *__cpu_spinwait_stack_pointer[NR_CPUS] __section(".data");
 void *__cpu_spinwait_task_pointer[NR_CPUS] __section(".data");

Thanks, this is on for-next.

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