LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] xen/balloon: fix unused-variable warning
@ 2021-11-08 11:14 Arnd Bergmann
  2021-11-08 16:24 ` Juergen Gross
  2021-11-09 13:30 ` Boris Ostrovsky
  0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2021-11-08 11:14 UTC (permalink / raw)
  To: Boris Ostrovsky, Juergen Gross
  Cc: Arnd Bergmann, Stefano Stabellini, Oscar Salvador, Pankaj Gupta,
	Andrew Morton, David Hildenbrand, xen-devel, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

In configurations with CONFIG_XEN_BALLOON_MEMORY_HOTPLUG=n
and CONFIG_XEN_BALLOON_MEMORY_HOTPLUG=y, gcc warns about an
unused variable:

drivers/xen/balloon.c:83:12: error: 'xen_hotplug_unpopulated' defined but not used [-Werror=unused-variable]

Since this is always zero when CONFIG_XEN_BALLOON_MEMORY_HOTPLUG
is disabled, turn it into a preprocessor constant in that case.

Fixes: 121f2faca2c0 ("xen/balloon: rename alloc/free_xenballooned_pages")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/xen/balloon.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c
index ad9ba1e97450..ba2ea11e0d3d 100644
--- a/drivers/xen/balloon.c
+++ b/drivers/xen/balloon.c
@@ -80,9 +80,8 @@
 static uint __read_mostly balloon_boot_timeout = 180;
 module_param(balloon_boot_timeout, uint, 0444);
 
-static int xen_hotplug_unpopulated;
-
 #ifdef CONFIG_XEN_BALLOON_MEMORY_HOTPLUG
+static int xen_hotplug_unpopulated;
 
 static struct ctl_table balloon_table[] = {
 	{
@@ -115,6 +114,8 @@ static struct ctl_table xen_root[] = {
 	{ }
 };
 
+#else
+#define xen_hotplug_unpopulated 0
 #endif
 
 /*
-- 
2.29.2


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

end of thread, other threads:[~2021-11-09 13:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-08 11:14 [PATCH] xen/balloon: fix unused-variable warning Arnd Bergmann
2021-11-08 16:24 ` Juergen Gross
2021-11-09 13:30 ` Boris Ostrovsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).