All of 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 related	[flat|nested] 3+ messages in thread

* Re: [PATCH] xen/balloon: fix unused-variable warning
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Juergen Gross @ 2021-11-08 16:24 UTC (permalink / raw)
  To: Arnd Bergmann, Boris Ostrovsky
  Cc: Arnd Bergmann, Stefano Stabellini, Oscar Salvador, Pankaj Gupta,
	Andrew Morton, David Hildenbrand, xen-devel, linux-kernel


[-- Attachment #1.1.1: Type: text/plain, Size: 676 bytes --]

On 08.11.21 12:14, Arnd Bergmann wrote:
> 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>

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen


[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3135 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

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

* Re: [PATCH] xen/balloon: fix unused-variable warning
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Boris Ostrovsky @ 2021-11-09 13:30 UTC (permalink / raw)
  To: Arnd Bergmann, Juergen Gross
  Cc: Arnd Bergmann, Stefano Stabellini, Oscar Salvador, Pankaj Gupta,
	Andrew Morton, David Hildenbrand, xen-devel, linux-kernel


On 11/8/21 6:14 AM, Arnd Bergmann wrote:
> 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>



Applied to for-linus-5.16b


-boris


^ 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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.