Received: by 10.223.185.116 with SMTP id b49csp1099201wrg; Tue, 20 Feb 2018 13:18:46 -0800 (PST) X-Google-Smtp-Source: AH8x227elLUOtErnY6fyne/KAHeQvh0nI6MGrkNYCpVkr0wH/FRSvN3vn2Shf0HSJGRSIKvPeVJ0 X-Received: by 10.101.77.140 with SMTP id p12mr741396pgq.195.1519161526244; Tue, 20 Feb 2018 13:18:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519161526; cv=none; d=google.com; s=arc-20160816; b=L43PG5rukXgEZZ4C9lYOCA+XvS1ih1tfwXpyeJ5VTwnbfZIAAiAXJrK7xyQACkRJUM 3OzxHEWwJ2dSWMg5n8DsB9rnpzga0dLnvkwGyqjDTLpx1fnb1w3n0RZZUcgTaNMIdLw+ aY0SyhGXu8qCydxOjsm5BWZlevabwkuMcVtuVwShFnA4gesgY3WwQS4luwkewHcPjz3T 1xo8guEXkdUmI8KeAx/cYn3EzXsPdL1lRLGFHZxT6/eLk/G/0C57luJBsDa0ikHNWQi/ GRlm8WwwOvZDbAPlHR/a0FjD0BuUZ/p7ghBmLz+gcv/O0Z2Yiq0zvSKQANFO6wXjkXg6 DfOg== 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 d12si249219pgt.558.2018.02.20.13.18.31; Tue, 20 Feb 2018 13:18:46 -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 S1751459AbeBTVRo (ORCPT + 99 others); Tue, 20 Feb 2018 16:17:44 -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(+) 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; -- 2.9.0