Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp4793567pxy; Tue, 27 Apr 2021 12:47:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwlZ9NuHLAf/ryU2Lk8ysK1xWrZdkGYQ24wbdPBq596hOtG08a6XgjXrYDqABVOyr6YFATl X-Received: by 2002:a05:6402:4d1:: with SMTP id n17mr6340865edw.118.1619552843718; Tue, 27 Apr 2021 12:47:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619552843; cv=none; d=google.com; s=arc-20160816; b=VPANvCXyr7rA+nYcsCH3XjxrQe+jqqr9ZxMrHRF+pXBcwxQP5FYNhtckD5of8reCyy Gm6m/OcSzgA8AzDaXxGT0crgdRhQX7GecX3zmn3Amr61SKH9SfnakLT0DXFRXnHeArfU dLEnJa9BDagXYum291QmUh9jIy2+yc01Dy8XXcPDz2ltVQCaYEeONX9jmwMNx4rPiErP +eNlbQttMKWk6VjMb24PZ+xbur72m1iqJmWKPI5Oc1b2cXfr2ld1Wm+P54gVWojns+p/ lU3TtiNtj8ZqUuZu0bXA9v9rQCKCsLokRciNJ2/uLJqAfl+GzHcWsKA8xkS4fclhx0VB dpDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=skdrZ6q0Cq9tX9lqK66FJzwUFI74j24Xps4+UlFystQ=; b=p+xMLr4xWrmyWWJwVpW1OqtDxBF5a0nOcurgEhR05/fMCYLVO4CxcE+VI/Fpvf5K7d 3NGYGv8uYhHs2LMPmLdpT1lfR6ZT07z/h7me6ptBzRDdbK/8jOGuP+g78cSqP0/V0ozs vsov2jBOookFT1nfM4PyRovWpBdblyCds8EZDYRw55LQ3BCs5TWatOvCbtqzhAxW9yIv YrJ30jIwGIBzOkWq+3qBJMArQEi1BCnKp3WzO18o12Duoy61vhdlpHc1OKDpECV2qsmZ 6pu6xqftNTbAXWFx8MRE1p4gONOX57aBfoUmMIiRqFNDsLlSgjnoLimCumqhIrbG4Fpi 1KOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="P6EaCGT/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d14si3581186edx.122.2021.04.27.12.47.00; Tue, 27 Apr 2021 12:47:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="P6EaCGT/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238822AbhD0Tqd (ORCPT + 99 others); Tue, 27 Apr 2021 15:46:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:50100 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235661AbhD0Tqc (ORCPT ); Tue, 27 Apr 2021 15:46:32 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id AFD8C611F2; Tue, 27 Apr 2021 19:45:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1619552748; bh=LDoohEnCArlGbum8fJyPABYpTo/IiOc7gWRCmRENEKk=; h=From:To:Cc:Subject:Date:From; b=P6EaCGT/1tkDXdwDRUEY2vhTWX1m+SMp/BC74NckIuFC3v52raY7xWHQJXhbwF6FC 1oIkAOqxAY2PspZWRW1Nf/SB0VXMIR17dorDxV1tN9tL1Z+fkpyj1PVC9mICvAqw2R 2SADRJxZmjuFQGI9SX+gi16LHTbQdq936nnHSjjw2oWO9E78aU6Ib6kn9UY8YmRP0g 6YXVqpzpBlX91HsXDQGVRnfG3omFaTieOBP8z0Znu7ztm/LKedkUZJw/IdV/BfYDuM VyCIS2E6hkCMfDmm1i/tBS8xuJlyX2mmiq6qR6N1hoEnURQIrPTsnGOJxg1mef+/EL Y6FLqYORW4mfQ== From: Arnd Bergmann To: Pablo Neira Ayuso , Jozsef Kadlecsik , Florian Westphal , "David S. Miller" , Jakub Kicinski Cc: Arnd Bergmann , Balazs Scheidler , netfilter-devel@vger.kernel.org, coreteam@netfilter.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] netfilter: nft_socket: fix an unused variable warning Date: Tue, 27 Apr 2021 21:45:18 +0200 Message-Id: <20210427194528.2325108-1-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann The variable is only used in an #ifdef, causing a harmless warning: net/netfilter/nft_socket.c: In function 'nft_socket_init': net/netfilter/nft_socket.c:137:27: error: unused variable 'level' [-Werror=unused-variable] 137 | unsigned int len, level; | ^~~~~ Move it into the same #ifdef block. Fixes: e0bb96db96f8 ("netfilter: nft_socket: add support for cgroupsv2") Signed-off-by: Arnd Bergmann --- net/netfilter/nft_socket.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/net/netfilter/nft_socket.c b/net/netfilter/nft_socket.c index 9c169d100651..f9c5ff6024e0 100644 --- a/net/netfilter/nft_socket.c +++ b/net/netfilter/nft_socket.c @@ -134,7 +134,7 @@ static int nft_socket_init(const struct nft_ctx *ctx, const struct nlattr * const tb[]) { struct nft_socket *priv = nft_expr_priv(expr); - unsigned int len, level; + unsigned int len; if (!tb[NFTA_SOCKET_DREG] || !tb[NFTA_SOCKET_KEY]) return -EINVAL; @@ -160,7 +160,9 @@ static int nft_socket_init(const struct nft_ctx *ctx, len = sizeof(u32); break; #ifdef CONFIG_CGROUPS - case NFT_SOCKET_CGROUPV2: + case NFT_SOCKET_CGROUPV2: { + unsigned int level; + if (!tb[NFTA_SOCKET_LEVEL]) return -EINVAL; @@ -171,6 +173,7 @@ static int nft_socket_init(const struct nft_ctx *ctx, priv->level = level; len = sizeof(u64); break; + } #endif default: return -EOPNOTSUPP; -- 2.29.2