From patchwork Tue Oct 2 21:06:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 148020 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp5635349lji; Tue, 2 Oct 2018 14:06:40 -0700 (PDT) X-Google-Smtp-Source: ACcGV613cj5ViBfVPstVBMM1avWfsoaHCUbjZdqJlwM8najJsq2eWYgVP+HCgR0LCdnM6qQUyp0U X-Received: by 2002:a17:902:bc4a:: with SMTP id t10-v6mr18617716plz.66.1538514400733; Tue, 02 Oct 2018 14:06:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538514400; cv=none; d=google.com; s=arc-20160816; b=wU8JytMkgoIzMoxOr+IC1KHp0buvmEAq0Lm2OPWZw1yaCnXrsDiMqzniGQirp6BRI2 PjAtwfwC5eUEynypwPE73Up+1B12YdNno/iuMODAANuctNak2SjOgKLDaJYHZRzAKlMZ /9SX55T+aBHfO10RmYvwipbQ6KW3ove+b7JU7SVOtJQU2kTDUXGuYI4J8tvG6l/qy9EY N32xbpyfgoJIfkDLXhaI3ukFZVhtmTIUgMjhOrwTiswHoKREIz9LU3kAGzLnq9zQGfl6 usyz50Hnq26zpEtN8baXFt4B62wU8lMX64lsrTQkB/qvrTj6CY94LLisNuCJLvp11h4h Ys2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=FG6NFovaaLBg0oX2rdotc28PyxszJQ2ViK30W+Ow8JU=; b=A9acB39SzGGTuC8CTnrMESxxzV4B6h2DETo2lf2HNJ60k5OHStlpUsw6ah+CVWrOOc g8C2XAASePoQb0UMlCvx86pmSi2emXv8D/I+VXMSv+owFvkCSmcbzBrEVitq/fVYU+Ef DKavh4izwaKiNNQsLloxo9sUlCYXB8SPT+mHyZDukCB2ULd0zlZ+iIyZL4awm/LYS7g9 rvOQokh47BK20Lc/joWE68kwO8UC3gIANGsCQqU50dI8/Yxm9I0kP3JUWPjFtlNharvb oSPbliRfzq4KyoxXc3bpqXJY2qmHyEd78MS99SfADNiGVw3+mWKAbduISWk/1TScfory 2+WA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l72-v6si2354573pfk.165.2018.10.02.14.06.40; Tue, 02 Oct 2018 14:06:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728051AbeJCDvy (ORCPT + 32 others); Tue, 2 Oct 2018 23:51:54 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:45909 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726552AbeJCDvx (ORCPT ); Tue, 2 Oct 2018 23:51:53 -0400 Received: from wuerfel.lan ([109.193.40.16]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.145]) with ESMTPA (Nemesis) id 1MUog3-1gFwBL2wEb-00QfuK; Tue, 02 Oct 2018 23:06:22 +0200 Received: from wuerfel.lan ([109.193.40.16]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.145]) with ESMTPA (Nemesis) id 1MUog3-1gFwBL2wEb-00QfuK; Tue, 02 Oct 2018 23:06:22 +0200 From: Arnd Bergmann To: Matthew Wilcox , Arnd Bergmann Cc: linux-kernel@vger.kernel.org Subject: [PATCH] xarray: fix unused-variable warnings Date: Tue, 2 Oct 2018 23:06:08 +0200 Message-Id: <20181002210621.2538114-1-arnd@arndb.de> X-Mailer: git-send-email 2.18.0 X-Provags-ID: V03:K1:tjC3FWE0G2awhN76A3IR6mzTzy4YZtXfUIc0p8AXEGoNyQwf9mo qera5pmtYEavoFtAlJxvlEOsA0LLM5/zkCd9jLGeTz65MJ1BQrkpWqVF9CzK9oATA2M3Cp9 X/qVDrvd4LG5TjK2h573dmcGsM1MjSJtWs156AOBch+txpsqB0MH7hmvB1XJ20pN+Ejdvv6 Jd3jz4DmuYVHwgZvAo3SA== X-UI-Out-Filterresults: notjunk:1; V01:K0:6SF4fEfrFns=:/nC6iFfr4YtlOXpF9OWjxP ltcH5xNR+N6QO9Cpj6MzGb57udwbD2ezaI4g9sN1C8YsSnR19RLVPSCe8GS93eECwVnl7TSz4 nXYNqwSMxYt8p9e+rq66rV9G4mWDz5PcB8tJ777PxfDlTlickNQG3o8KnWwaHnuGhACjD0AVL Z+uR1A0cmAcgwzx8Uocyza2L5xuIeYuFDiRV7PLBdwRZt7p2artJpfU9nmpUsXskMO+2PrHTK WbVBKP0wnmMd2r9MiSyQdPSaZ196l2EAC/oApRThwRZlWLGBT+MUfor/6b3dMa/ePFN9TaqNB KfPXNX702nBftTtkl4HXADKq0XJnnirMVsMiFcepHLq/aGCle6m9MDTsvTFmOeCN5aunIPx5t bUnjhGenpNHvOHK2up4DC5+X3WdXN+CXJU+dOIGxo/nsCOe/Et8aJ2AcyORKf8Y+vDW9CDX4B ezigkGRHHeZBbOUwX+O9r/yxktrEqsh57vVPMgQXQFmN/rrvBDOJuU7P3oGScmFr5L8WZVCsP eDVIlTEJou0qUzdajcTVAvlpjAnUFSoX/uxJXy/TQb2qX4zs9pyIzfdSCuzVkrwwhcZdHa6n7 4zCYuRnyNygle8yjRkJD9IbjwyM6Dl3eLYTO80kyuQ2ZICzo83IW05DnupssZwNedJMEnM97n BJUH3RCsL4CdcHzERVkGiZYo3tw+/Jbsmy3+pU1IWOO7ytMGwq2nZuF8vop43DrdOzDs= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- lib/test_xarray.c | 4 ++++ 1 file changed, 4 insertions(+) -- 2.18.0 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);