lkml.org 
[lkml]   [2018]   [Oct]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] xarray: fix unused-variable warnings
Date
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@arndb.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
\
 
 \ /
  Last update: 2018-10-02 23:06    [W:0.037 / U:0.224 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site