Skip to contentSkip to conversation

linux-next: build warning after merge of the tip tree

PATCH Applied Stephen Rothwell 3 participants 4 messages Apr 28, 2020 – May 3, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Hi all,

After merging the tip tree, today's linux-next build (x86_64 allnoconfig) produced this warning:

arch/x86/kernel/unwind_orc.c:29:26: warning: 'cur_orc_table' defined but not used [-Wunused-variable]

   29 | static struct orc_entry *cur_orc_table = __start_orc_unwind;
      |                          ^~~~~~~~~~~~~
arch/x86/kernel/unwind_orc.c:28:13: warning: 'cur_orc_ip_table' defined but not used [-Wunused-variable]
   28 | static int *cur_orc_ip_table = __start_orc_unwind_ip;
      |             ^~~~~~~~~~~~~~~~

Exposed by commit

153eb2223c79 ("x86/unwind/orc: Convert global variables to static")

This build has CONFIG_MODULE not set.

Signature · 2 lines
Cheers,
Stephen Rothwell
#1 lore raw

PATCH 1/1 x86/unwind/orc: Move ORC sorting variables under CONFIG_MODULE

Fix the following warnings seen with !CONFIG_MODULE:

arch/x86/kernel/unwind_orc.c:29:26: warning: 'cur_orc_table' defined but not used [-Wunused-variable]

     29 | static struct orc_entry *cur_orc_table = __start_orc_unwind;
        |                          ^~~~~~~~~~~~~
  arch/x86/kernel/unwind_orc.c:28:13: warning: 'cur_orc_ip_table' defined but not used [-Wunused-variable]
     28 | static int *cur_orc_ip_table = __start_orc_unwind_ip;
        |             ^~~~~~~~~~~~~~~~
Fixes 153eb2223c79 ("x86/unwind/orc: Convert global variables to static")
---
 arch/x86/kernel/unwind_orc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
arch/x86/kernel/unwind_orc.c +4 -4
index 0ebc11a8bb45..5b0bd8581fe6 100644
@@ -24,10 +24,6 @@ extern struct orc_entry __stop_orc_unwind[];
 static bool orc_init __ro_after_init;
 static unsigned int lookup_num_blocks __ro_after_init;
 
-static DEFINE_MUTEX(sort_mutex);
-static int *cur_orc_ip_table = __start_orc_unwind_ip;
-static struct orc_entry *cur_orc_table = __start_orc_unwind;
-
 static inline unsigned long orc_ip(const int *ip)
 {
 	return (unsigned long)ip + *ip;
@@ -192,6 +188,10 @@ static struct orc_entry *orc_find(unsigned long ip)
 
 #ifdef CONFIG_MODULES
 
+static DEFINE_MUTEX(sort_mutex);
+static int *cur_orc_ip_table = __start_orc_unwind_ip;
+static struct orc_entry *cur_orc_table = __start_orc_unwind;
+
 static void orc_sort_swap(void *_a, void *_b, int size)
 {
 	struct orc_entry *orc_a, *orc_b;
Signature · 1 line
2.21.1
#2 lore raw

Re: [PATCH] x86/unwind/orc: Move ORC sorting variables under CONFIG_MODULE

Quoted 1 line · Josh Poimboeuf

Fix the following warnings seen with !CONFIG_MODULE:

s/MODULE/MODULES/ here and $SUBJECT.

Signature · 1 line
Josh
merge bot Applied
#3 lore raw

[tip: x86/urgent] x86/unwind/orc: Move ORC sorting variables under !CONFIG_MODULES

In reply to Josh Poimboeuf
The following commit has been merged into the x86/urgent branch of tip:

The following commit has been merged into the x86/urgent branch of tip:

Commit-ID:     fb9cbbc895eb6e986dc90c928a35c793d75f435a
Gitweb:        https://git.kernel.org/tip/fb9cbbc895eb6e986dc90c928a35c793d75f435a
Author:        Josh Poimboeuf <[email protected]>
AuthorDate:    Tue, 28 Apr 2020 02:16:40 -05:00
Committer:     Ingo Molnar <[email protected]>
CommitterDate: Sun, 03 May 2020 13:23:28 +02:00

x86/unwind/orc: Move ORC sorting variables under !CONFIG_MODULES

Fix the following warnings seen with !CONFIG_MODULES:

arch/x86/kernel/unwind_orc.c:29:26: warning: 'cur_orc_table' defined but not used [-Wunused-variable]

     29 | static struct orc_entry *cur_orc_table = __start_orc_unwind;
        |                          ^~~~~~~~~~~~~
  arch/x86/kernel/unwind_orc.c:28:13: warning: 'cur_orc_ip_table' defined but not used [-Wunused-variable]
     28 | static int *cur_orc_ip_table = __start_orc_unwind_ip;
        |             ^~~~~~~~~~~~~~~~
Fixes 153eb2223c79 ("x86/unwind/orc: Convert global variables to static")
Cc H. Peter Anvin <[email protected]>
Cc Linux Next Mailing List <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
---
 arch/x86/kernel/unwind_orc.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
arch/x86/kernel/unwind_orc.c +4 -4
index 0ebc11a..5b0bd85 100644
@@ -24,10 +24,6 @@ extern struct orc_entry __stop_orc_unwind[];
 static bool orc_init __ro_after_init;
 static unsigned int lookup_num_blocks __ro_after_init;
 
-static DEFINE_MUTEX(sort_mutex);
-static int *cur_orc_ip_table = __start_orc_unwind_ip;
-static struct orc_entry *cur_orc_table = __start_orc_unwind;
-
 static inline unsigned long orc_ip(const int *ip)
 {
 	return (unsigned long)ip + *ip;
@@ -192,6 +188,10 @@ static struct orc_entry *orc_find(unsigned long ip)
 
 #ifdef CONFIG_MODULES
 
+static DEFINE_MUTEX(sort_mutex);
+static int *cur_orc_ip_table = __start_orc_unwind_ip;
+static struct orc_entry *cur_orc_table = __start_orc_unwind;
+
 static void orc_sort_swap(void *_a, void *_b, int size)
 {
 	struct orc_entry *orc_a, *orc_b;