linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PROBLEM] mm/vmstat.c:34:12: error: ‘vmstat_late_init_done’ defined but not used [-Werror=unused-variable]
@ 2024-08-13 22:03 Mirsad Todorovac
  2024-08-13 23:18 ` [RFC] " Mirsad Todorovac
  0 siblings, 1 reply; 4+ messages in thread
From: Mirsad Todorovac @ 2024-08-13 22:03 UTC (permalink / raw)
  To: linux-mm; +Cc: Andrew Morton, linux-kernel, Saurabh Sengar

Hi, all,

Now, the "randconfig" seed KCONFIG_SEED=0x44AB31A6 revealed another bug:

mm/vmstat.c:34:12: error: ‘vmstat_late_init_done’ defined but not used [-Werror=unused-variable]
   34 | static int vmstat_late_init_done;
      |            ^~~~~~~~~~~~~~~~~~~~~

Apparently, it is obviously wrong because it is used below:

Fixes: ef534a0d51984 ("mm/vmstat: defer the refresh_zone_stat_thresholds after all CPUs bringu")

#ifdef .. #endif forest might be better documented, but this small fix makes it running
again:

-----------------------------------------------------><----------------------------------
diff --git a/mm/vmstat.c b/mm/vmstat.c
index e361c2b3a8bc..85b3fc0084a8 100644
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -31,7 +31,10 @@

 #include "internal.h"

+#ifdef CONFIG_SMP
 static int vmstat_late_init_done;
+#endif /* CONFIG_SMP */
+
 #ifdef CONFIG_NUMA
 int sysctl_vm_numa_stat = ENABLE_NUMA_STAT;

--

It eliminates -Werror=unused-variable and compile passes at least:

  CC      kernel/sys.o
  CC      mm/vmstat.o
  AR      init/built-in.a

Hope thi s helps.

Best regards,
Mirsad Todorovac


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-08-14 18:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-13 22:03 [PROBLEM] mm/vmstat.c:34:12: error: ‘vmstat_late_init_done’ defined but not used [-Werror=unused-variable] Mirsad Todorovac
2024-08-13 23:18 ` [RFC] " Mirsad Todorovac
2024-08-14  3:09   ` Matthew Wilcox
2024-08-14 18:37     ` Mirsad Todorovac

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox