From patchwork Tue Feb 20 21:16:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 128972 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp5071990ljc; Tue, 20 Feb 2018 13:17:48 -0800 (PST) X-Google-Smtp-Source: AH8x226E2InXmUgE9fq/Jap9XDsGKI34/69MKcq9yKYvJrVKAK6vdvVrhIqwTBEBPaLKvOcgoCeu X-Received: by 10.101.70.10 with SMTP id v10mr742223pgq.327.1519161468455; Tue, 20 Feb 2018 13:17:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519161468; cv=none; d=google.com; s=arc-20160816; b=xejuYFPp3Z/nPgB3CeiGCoXPz5x1XTaOHmxh+VOyi6nZiAlOJn/TIKLtxmxGswlxLb y9XCYv9WAznwQl1rVt0delBTaaam1oV1A3eK+TxC1evvYvSkD87652/Mdj/+mZDsJrYd 8Q1fnws/bqI3NtH+6Z4syhkWqcEGEhfVqZ9c7XL7GMQLxLWjaSO/Vh5sv4YYuhEvuZIW hGzKQZk2KzkcSBOntIqGdzTrdPXTxj3IZKIj8t3BZ2VPViKlHf5Mt3m7QaisfpCgbkR9 tzSml9b6zA8vTfUPyjUkf3Yacl4xjFsKPKW0g0/7MA+l/UTlTZR2312vqiLXchVGIghr Dx6g== 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 :arc-authentication-results; bh=OIWjYeRiUc1+73n0oz6yg1XZ6NRm8xb5efwckDvKLbU=; b=jwbceqmllB+oS3DB2Wrdu08FQjbRgCPkHUKrlgGZaUtApV3JVPNKkMLf/VuXaZQI0G H96xITTMF5OIEEGOmDh7CrVXGpXR6eG6NdVhh0ACjfP1DrgYLvZOK7YhRuie/ZOXx8XI EvW7l+Fev6cy7rUhiJ2gaWkdghCxRodJWTlcBh7QeQpBapuUXOD/u5LBBM3BCM1EkkrB J60FWuVHx+E4Q3NtxLoUeWeZAqFgK1MsQKu61Tb3QD78HxeitUxmKwxb/4ArRPdBg636 c/LKpzdmBjTE7lTSsmd4kb1cOLu+OjMWCjcjND7XADXQHjPP4rvr+eBJSJ9nMduSga2R lHWA== 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 b14si445073pgv.169.2018.02.20.13.17.48; Tue, 20 Feb 2018 13:17:48 -0800 (PST) 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 S1751463AbeBTVRp (ORCPT + 28 others); Tue, 20 Feb 2018 16:17:45 -0500 Received: from mout.kundenserver.de ([212.227.126.131]:35151 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750799AbeBTVRn (ORCPT ); Tue, 20 Feb 2018 16:17:43 -0500 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue006 [212.227.15.129]) with ESMTPA (Nemesis) id 0MNRWv-1eqiG73tov-006uW1; Tue, 20 Feb 2018 22:17:03 +0100 From: Arnd Bergmann To: Alexei Starovoitov , Daniel Borkmann , "David S. Miller" Cc: Arnd Bergmann , John Fastabend , Lawrence Brakmo , Jesper Dangaard Brouer , Jakub Kicinski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] bpf: hide a possibly unused variable Date: Tue, 20 Feb 2018 22:16:45 +0100 Message-Id: <20180220211658.2653840-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:Wd3m1159afi0/gUhNZDvnipyIXg0Lf6DSLG//WQfAWbzdPln2fy /86hQ5O1Tsp5jar4AtlASRdJmSxXRVcG3uZW2gZz7wHNS4M7GQL5f4/yzPjgEG8dSyqdMIG D5keBu/s3kcq5N14/1h0LqOVrsCjN8CMv1OHekOH6VnHstVYQ0CtEhDoxBDPYYPx3BnxeHF g5dKiZr6msVggZOdIX0lg== X-UI-Out-Filterresults: notjunk:1; V01:K0:IhdV52ROGsg=:I9N2APto/s7W57vrlI9Uo6 mBLdV/PfFKzOTacZSt2lF5HoOyggP7pgJdJBAEyJLALlaGUPqTHQZKCbCoOb32cMpGRDOjCIg 70b7qIQ884m+r/3wJMsOPflLDjkd3tcyOAXtJMnjr7qDfPbAPJ4q393RdSKb3b3lMMViK+yZX lb50ZiG8ET/wNzG5o69GHHxyOjx6aJLQ3S/rd2aBh6ZtxR8omj64V69Of8mxnEEhDibJBBv8e 3YiPxG+s/5ze8fVKCg1NnpnIFK7z8UqsEqLAvXot3XtlAN/ViCEq5e9bJ0QRJBNFVIYKGWggr ORZ++T10JPdPyXl1D5ZLu0HLvtt1lyFXuV9GddvAElj103x/Q3lmJS68D9IwtQ7gHUwarum7G lEWKQfLsl5H9QSlX9fRRMEhKYzRefpJlgz39H71ioQwMCcnCPEsCobBJDC3zMf3C1Z60lQzW5 VE/czFSnmkerx2OnyuLHrKFMEh6SoPPAqMfzEpcod5rnzLegZz6JHHvg003Ex54yHp6g+zrtj VXelhTJA1qjFxuEAoFmDapxnGeuoL44AMLsNJ2x4yLg9khbpUUyDePGYwWL8avSx6zc+rYnxY 6Fel0LWkcQ7pD11AWkaGhFLPDaHzug9IK/d7RJyx2PxrTdbi9GMcQBnUe7SuRQNaZZ3o/31qX Y1c5Zarxd0Bgo7hFumfhi8Zqz9RltNYxxoMzP7ug6a04tv0DZIoRwhL2cvnZdUXEunIZXM/qm SdI5sTAlY5xGP8hbaeI6WWAhOIYShcm83gExcQ== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The only user of this variable is inside of an #ifdef, causing a warning without CONFIG_INET: net/core/filter.c: In function '____bpf_sock_ops_cb_flags_set': net/core/filter.c:3382:6: error: unused variable 'val' [-Werror=unused-variable] int val = argval & BPF_SOCK_OPS_ALL_CB_FLAGS; This adds the same #ifdef around the declaration. Fixes: b13d88072172 ("bpf: Adds field bpf_sock_ops_cb_flags to tcp_sock") Signed-off-by: Arnd Bergmann --- net/core/filter.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.9.0 diff --git a/net/core/filter.c b/net/core/filter.c index 08ab4c65a998..c3dc6d60b4bb 100644 --- a/net/core/filter.c +++ b/net/core/filter.c @@ -3379,7 +3379,9 @@ BPF_CALL_2(bpf_sock_ops_cb_flags_set, struct bpf_sock_ops_kern *, bpf_sock, int, argval) { struct sock *sk = bpf_sock->sk; +#ifdef CONFIG_INET int val = argval & BPF_SOCK_OPS_ALL_CB_FLAGS; +#endif if (!sk_fullsock(sk)) return -EINVAL;