lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20181002210621.2538114-1-arnd@arndb.de>
Date:   Tue,  2 Oct 2018 23:06:08 +0200
From:   Arnd Bergmann <arnd@...db.de>
To:     Matthew Wilcox <willy@...radead.org>, Arnd Bergmann <arnd@...db.de>
Cc:     linux-kernel@...r.kernel.org
Subject: [PATCH] xarray: fix unused-variable warnings

Two variables that are only used in an #ifdef cause compiler warnings:

lib/test_xarray.c: In function 'check_xa_tag_1':
lib/test_xarray.c:162:15: error: unused variable 'order' [-Werror=unused-variable]
  unsigned int order;

lib/test_xarray.c: In function 'check_xa_shrink':
lib/test_xarray.c:288:15: error: unused variable 'order' [-Werror=unused-variable]
  unsigned int order;

Add another #ifdef around the declaration to avoid the warning.

Fixes: 4f79afaf4662 ("xarray: Move multiorder_shrink to kernel tests")
Fixes: 137689411a26 ("xarray: Move multiorder account test in-kernel")
Signed-off-by: Arnd Bergmann <arnd@...db.de>
---
 lib/test_xarray.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/test_xarray.c b/lib/test_xarray.c
index ef68a3f0fc4c..1f3674fda53d 100644
--- a/lib/test_xarray.c
+++ b/lib/test_xarray.c
@@ -159,7 +159,9 @@ static noinline void check_xa_load(struct xarray *xa)
 
 static noinline void check_xa_tag_1(struct xarray *xa, unsigned long index)
 {
+#ifdef CONFIG_XARRAY_MULTI
 	unsigned int order;
+#endif
 
 	/* NULL elements have no tags set */
 	XA_BUG_ON(xa, xa_get_mark(xa, index, XA_MARK_0));
@@ -285,7 +287,9 @@ static noinline void check_xa_shrink(struct xarray *xa)
 {
 	XA_STATE(xas, xa, 1);
 	struct xa_node *node;
+#ifdef CONFIG_XARRAY_MULTI
 	unsigned int order;
+#endif
 
 	XA_BUG_ON(xa, !xa_empty(xa));
 	XA_BUG_ON(xa, xa_store_index(xa, 0, GFP_KERNEL) != NULL);
-- 
2.18.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ