Skip to contentSkip to conversation

smp: kernel/panic.c - silence warnings

PATCH Superseded He Ying 3 participants 5 messages Mar 16, 2021

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

He Ying

author
#0 lore raw

PATCH 1/1 smp: kernel/panic.c - silence warnings

We found these warnings in kernel/panic.c by using sparse tool:
warning: symbol 'panic_smp_self_stop' was not declared.
warning: symbol 'nmi_panic_self_stop' was not declared.
warning: symbol 'crash_smp_send_stop' was not declared.

To avoid them, add declarations for these three functions in include/linux/smp.h.

---
 include/linux/smp.h | 8 ++++++++
 1 file changed, 8 insertions(+)
include/linux/smp.h +8 -0
index 70c6f6284dcf..861a253cc179 100644
@@ -50,6 +50,14 @@ extern unsigned int total_cpus;
 int smp_call_function_single(int cpuid, smp_call_func_t func, void *info,
 			     int wait);
 
+/*
+ * Cpus stopping functions in panic. All have default weak definations.
+ * Architecure dependent code may override them.
+ */
+void panic_smp_self_stop(void);
+void nmi_panic_self_stop(struct pt_regs *regs);
+void crash_smp_send_stop(void);
+
 /*
  * Call a function on all processors
  */
Signature · 1 line
2.17.1
#1 lore raw
Quoted 19 lines · He Ying

We found these warnings in kernel/panic.c by using sparse tool:
warning: symbol 'panic_smp_self_stop' was not declared.
warning: symbol 'nmi_panic_self_stop' was not declared.
warning: symbol 'crash_smp_send_stop' was not declared.

To avoid them, add declarations for these three functions in include/linux/smp.h.

---
 include/linux/smp.h | 8 ++++++++
 1 file changed, 8 insertions(+)
include/linux/smp.h +0 -0
index 70c6f6284dcf..861a253cc179 100644

include/linux/smp.h extern unsigned int total_cpus; · line 54

Quoted 5 lines
include/linux/smp.h +2 -0
@@ -50,6 +50,14 @@ extern unsigned int total_cpus;
 int smp_call_function_single(int cpuid, smp_call_func_t func, void *info,
 			     int wait);
 
+/*
+ * Cpus stopping functions in panic. All have default weak definations.

definitions.

include/linux/smp.h extern unsigned int total_cpus; · line 55

Quoted 1 line
include/linux/smp.h +1 -0
+ * Architecure dependent code may override them.

Architecture-dependent

Quoted 9 lines
include/linux/smp.h +5 -0
+ */
+void panic_smp_self_stop(void);
+void nmi_panic_self_stop(struct pt_regs *regs);
+void crash_smp_send_stop(void);
+
 /*
  * Call a function on all processors
  */
Signature · 1 line
~Randy
author
#2 lore raw

Thanks for your reply.

Quoted 23 lines · Randy Dunlap
Quoted 22 lines · He Ying

We found these warnings in kernel/panic.c by using sparse tool:
warning: symbol 'panic_smp_self_stop' was not declared.
warning: symbol 'nmi_panic_self_stop' was not declared.
warning: symbol 'crash_smp_send_stop' was not declared.

To avoid them, add declarations for these three functions in include/linux/smp.h.

---
  include/linux/smp.h | 8 ++++++++
  1 file changed, 8 insertions(+)
include/linux/smp.h +0 -0
index 70c6f6284dcf..861a253cc179 100644
@@ -50,6 +50,14 @@ extern unsigned int total_cpus;
  int smp_call_function_single(int cpuid, smp_call_func_t func, void *info,
  			     int wait);
 
Quoted 3 lines

include/linux/smp.h extern unsigned int total_cpus; · line 54

Quoted 2 lines
include/linux/smp.h +2 -0
+/*
+ * Cpus stopping functions in panic. All have default weak definations.

definitions.

Sorry for my typo.

Quoted 3 lines

include/linux/smp.h extern unsigned int total_cpus; · line 55

Quoted 2 lines
include/linux/smp.h +1 -0
+ * Architecure dependent code may override them.

Architecture-dependent

Is that necessary?

Quoted 12 lines
Quoted 11 lines
include/linux/smp.h +5 -0
+ */
+void panic_smp_self_stop(void);
+void nmi_panic_self_stop(struct pt_regs *regs);
+void crash_smp_send_stop(void);
+
  /*
   * Call a function on all processors
   */
#3 lore raw

Le 16/03/2021 à 07:35, heying (H) a écrit :

Quoted 29 lines

Thanks for your reply.

Quoted 15 lines · Randy Dunlap
Quoted 14 lines · He Ying

We found these warnings in kernel/panic.c by using sparse tool:
warning: symbol 'panic_smp_self_stop' was not declared.
warning: symbol 'nmi_panic_self_stop' was not declared.
warning: symbol 'crash_smp_send_stop' was not declared.

To avoid them, add declarations for these three functions in include/linux/smp.h.

---
  include/linux/smp.h | 8 ++++++++

  1 file changed, 8 insertions(+)
Quoted 10 lines

include/linux/smp.h extern unsigned int total_cpus; · line 53

Quoted 9 lines
include/linux/smp.h +2 -0
index 70c6f6284dcf..861a253cc179 100644
@@ -50,6 +50,14 @@ extern unsigned int total_cpus;
   int smp_call_function_single(int cpuid, smp_call_func_t func, void *info,
                    int wait);
+/*
+ * Cpus stopping functions in panic. All have default weak definations.

                                                               definitions.

Quoted 5 lines

Sorry for my typo.

Quoted 3 lines

include/linux/smp.h extern unsigned int total_cpus; · line 55

Quoted 2 lines
include/linux/smp.h +1 -0
+ * Architecure dependent code may override them.

       Architecture-dependent

Is that necessary?

Sure you are missing a 't'

Architecure ==> Architecture

Quoted 12 lines
Quoted 12 lines
Quoted 11 lines
include/linux/smp.h +5 -0
+ */
+void panic_smp_self_stop(void);
+void nmi_panic_self_stop(struct pt_regs *regs);
+void crash_smp_send_stop(void);
+
   /*
    * Call a function on all processors
    */
 
author
#4 lore raw

Dear Christophe and Randy,

You both are so nice. Thank you for your reply.

Quoted 35 lines · Christophe Leroy

Le 16/03/2021 à 07:35, heying (H) a écrit :

Quoted 32 lines

Thanks for your reply.

Quoted 15 lines · Randy Dunlap
Quoted 14 lines · He Ying

We found these warnings in kernel/panic.c by using sparse tool:
warning: symbol 'panic_smp_self_stop' was not declared.
warning: symbol 'nmi_panic_self_stop' was not declared.
warning: symbol 'crash_smp_send_stop' was not declared.

To avoid them, add declarations for these three functions in include/linux/smp.h.

---
  include/linux/smp.h | 8 ++++++++

  1 file changed, 8 insertions(+)
Quoted 11 lines
Quoted 10 lines
include/linux/smp.h +2 -0
index 70c6f6284dcf..861a253cc179 100644
@@ -50,6 +50,14 @@ extern unsigned int total_cpus;
   int smp_call_function_single(int cpuid, smp_call_func_t func, void *info,
                    int wait);
+/*
+ * Cpus stopping functions in panic. All have default weak 

definations.

definitions.

Sorry for my typo.

Quoted 1 line
Quoted 7 lines
Quoted 3 lines
Quoted 2 lines
Quoted 1 line

+ * Architecure dependent code may override them.

       Architecture-dependent

Is that necessary?

Sure you are missing a 't'

Architecure ==> Architecture

Oh, a misspelling again. Sorry about that. I'll fix it.

Quoted 14 lines
Quoted 13 lines
Quoted 13 lines
Quoted 8 lines

+ */

include/linux/smp.h +4 -0
+void panic_smp_self_stop(void);
+void nmi_panic_self_stop(struct pt_regs *regs);
+void crash_smp_send_stop(void);
+
Quoted 4 lines

  /*
   * Call a function on all processors
   */

.