]> Git Repo - linux.git/commitdiff
xen/balloon: fix unused-variable warning
authorArnd Bergmann <[email protected]>
Mon, 8 Nov 2021 11:14:02 +0000 (12:14 +0100)
committerBoris Ostrovsky <[email protected]>
Mon, 8 Nov 2021 16:40:17 +0000 (10:40 -0600)
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 <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Juergen Gross <[email protected]>
Signed-off-by: Boris Ostrovsky <[email protected]>
drivers/xen/balloon.c

index ad9ba1e97450f2506901e6397a03fccbf6061d0c..ba2ea11e0d3dda25902883f396e807f25f66ac04 100644 (file)
@@ -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
 
 /*
This page took 0.057466 seconds and 4 git commands to generate.