Skip to contentSkip to conversation

linux-next: build warning after merge of the akpm-current tree

DISCUSSION Stephen Rothwell 2 participants 2 messages Jul 17, 2020

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

Hi all,

After merging the akpm-current tree, today's linux-next build (powerpc ppc64_defconfig) produced this warning:

mm/vmstat.c:614: warning: "MAX_THRESHOLD" redefined
614 | #define MAX_THRESHOLD 0

      | 
mm/vmstat.c:172: note: this is the location of the previous definition
  172 | #define MAX_THRESHOLD 125
      | 
mm/vmstat.c:614: warning: "MAX_THRESHOLD" redefined
  614 | #define MAX_THRESHOLD 0
      | 
mm/vmstat.c:172: note: this is the location of the previous definition
  172 | #define MAX_THRESHOLD 125
      | 

Introduced by commit

5f6bac149e10 ("mm: vmstat: fix /proc/sys/vm/stat_refresh generating false warnings")

The preproccesor directives look like this:

#ifdef CONFIG_SMP
#define MAX_THRESHOLD 125
#ifdef CONFIG_HAVE_CMPXCHG_LOCAL
#else
#define MAX_THRESHOLD 0

So I guess the second MAX_THRESHOLD was put after the wrong #else?

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

Hi all,

After merging the akpm-current tree, today's linux-next build (powerpc ppc64_defconfig) produced this warning:

mm/vmstat.c:614: warning: "MAX_THRESHOLD" redefined
614 | #define MAX_THRESHOLD 0

      | 
mm/vmstat.c:172: note: this is the location of the previous definition
  172 | #define MAX_THRESHOLD 125
      | 
mm/vmstat.c:614: warning: "MAX_THRESHOLD" redefined
  614 | #define MAX_THRESHOLD 0
      | 
mm/vmstat.c:172: note: this is the location of the previous definition
  172 | #define MAX_THRESHOLD 125
      | 

Introduced by commit

5f6bac149e10 ("mm: vmstat: fix /proc/sys/vm/stat_refresh generating false warnings")

The preproccesor directives look like this:

Quoted 7 lines

#ifdef CONFIG_SMP
#define MAX_THRESHOLD 125
#ifdef CONFIG_HAVE_CMPXCHG_LOCAL
#else
#define MAX_THRESHOLD 0

So I guess the second MAX_THRESHOLD was put after the wrong #else?

Right, I missed it. Sorry for the inconvenience!
And thank you for pointing at it!

The following diff fixes it.

Andrew, can you, please, squash it into the
"mm: vmstat: fix /proc/sys/vm/stat_refresh generating false warnings" ?

Thank you!

--

mm/vmstat.c +4 -3
index 8f0ef8aaf8ee..08e415e0a15d 100644
@@ -168,9 +168,12 @@ EXPORT_SYMBOL(vm_numa_stat);
 EXPORT_SYMBOL(vm_node_stat);
 
 #ifdef CONFIG_SMP
-
 #define MAX_THRESHOLD 125
+#else
+#define MAX_THRESHOLD 0
+#endif
 
+#ifdef CONFIG_SMP
 int calculate_pressure_threshold(struct zone *zone)
 {
 	int threshold;
@@ -611,8 +614,6 @@ void dec_node_page_state(struct page *page, enum node_stat_item item)
 EXPORT_SYMBOL(dec_node_page_state);
 #else
 
-#define MAX_THRESHOLD 0
-
 /*
  * Use interrupt disable to serialize counter updates
  */
Signature · 1 line
2.26.2