linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Mirsad Todorovac <mtodorovac69@gmail.com>
To: linux-mm@kvack.org
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org,
	Saurabh Sengar <ssengar@linux.microsoft.com>
Subject: [PROBLEM] mm/vmstat.c:34:12: error: ‘vmstat_late_init_done’ defined but not used [-Werror=unused-variable]
Date: Wed, 14 Aug 2024 00:03:34 +0200	[thread overview]
Message-ID: <b604b19d-c548-4795-adb7-3d0736b8b560@alu.unizg.hr> (raw)

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


             reply	other threads:[~2024-08-13 22:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-13 22:03 Mirsad Todorovac [this message]
2024-08-13 23:18 ` [RFC] " Mirsad Todorovac
2024-08-14  3:09   ` Matthew Wilcox
2024-08-14 18:37     ` Mirsad Todorovac

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b604b19d-c548-4795-adb7-3d0736b8b560@alu.unizg.hr \
    --to=mtodorovac69@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ssengar@linux.microsoft.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox