From patchwork Mon Jul 8 12:57:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 168639 Delivered-To: patch@linaro.org Received: by 2002:ac9:6410:0:0:0:0:0 with SMTP id r16csp6516626ock; Mon, 8 Jul 2019 05:58:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqzdCjKjauIr4AlS3sYt1iluQwj8sBQJwjnF7FvLz7kogWqzP1Xpd60SXIBrjXslxYkme9Ss X-Received: by 2002:a17:90a:7148:: with SMTP id g8mr25651903pjs.51.1562590702101; Mon, 08 Jul 2019 05:58:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562590702; cv=none; d=google.com; s=arc-20160816; b=H0pWWXM9Upr/rn5NNZ93qWkfCA2wEoANlPmxrJuC63H4Cunm9eX6Bq0OJYTTqczXWM M2vdTcHeiUqW0kT1wqn+QtK0uCSbHhQKQck3TJfv0RKJv/ZOQFhosxUSITwXgy/rXn1J uUwr+Q3EkST2G2dOdhWfCtkmHdEygA2lqgOvPD36I+zNxF0ZvBTxSeacMILx8sZdCXAP NN6piq6ITW2jFilpq4HFHD0kShOWdmgW+cb9FN1Q8jTahX9uuPSWwMJztMVIuxZoLqhg n9YYLJHhhiIyUVAva7S9tvVuymLIFSi1fgZ07pMekb5LcHUqsQbpv03pJ8tCXsrAzWNv 67Zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=DOUco0oy1IK5pDmasIJqXyl/GxxdolCwAisksVc0QB4=; b=r2nOre25aQ5l25ELLKdHod1oCQsKxgbTW5Dj1dZIFoL0EQFL4gCl6Zp2nHlfmt94FU Ymtk5srWao575AvEZ9tV2IOkULSXxedouy/J/Q0rqaUiUK+0IuNYfpwMaS3lmsSnVVDm 0L+Y/ovfkZqqyXxMCSZj7nUPQ+HeijG//FCWNIrmQsads2R9G5tRgQ908xraO4dt8jc1 3m7VExHJrFt2c1vkbS/osWEE7BxtV74ica8e7Q0JvO5MVXnsqOexryo0H7bTGtPoJO1h cc3va9sUD48ZHQEBXI11i2Fg30VzzUAD7WBTijvoHFNtZyHg2Jii0nsBK39fYPM4vCUu w3Zw== 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 b20si19602088pfo.108.2019.07.08.05.58.21; Mon, 08 Jul 2019 05:58:22 -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 S1731159AbfGHM6U (ORCPT + 30 others); Mon, 8 Jul 2019 08:58:20 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:40755 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731040AbfGHM6U (ORCPT ); Mon, 8 Jul 2019 08:58:20 -0400 Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.129]) with ESMTPA (Nemesis) id 1MOz8O-1i9o621wUu-00PODH; Mon, 08 Jul 2019 14:57:46 +0200 From: Arnd Bergmann To: Eric Dumazet , "David S. Miller" , Alexei Starovoitov , Daniel Borkmann Cc: Arnd Bergmann , Priyaranjan Jha , Yuchung Cheng , Soheil Hassas Yeganeh , Stanislav Fomichev , Martin KaFai Lau , Song Liu , Yonghong Song , Neal Cardwell , Jason Baron , Yafang Shao , Ard Biesheuvel , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org Subject: [PATCH net-next 2/2] bpf: avoid unused variable warning in tcp_bpf_rtt() Date: Mon, 8 Jul 2019 14:57:21 +0200 Message-Id: <20190708125733.3944836-2-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20190708125733.3944836-1-arnd@arndb.de> References: <20190708125733.3944836-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:dI4LQODlR+/sYKWbgedywQqye07I8NlA3mUgYMxxT+wgW+CUrcV 0zvx/lBQ45HY1KIOI8Cfub13DGqUILRkHK98BazQS981rGHESAasKmwd9poT76wcJmC/cee x2onzLs9P8O/aWPlvOYPjABJWDmrOa3nIUAPIz8jTtS2kOIp87/rJSIUE36gkyVfKecvWUx DRAuyQEuOSJhN4mWH+xtA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V03:K0:vDZFZPrEgQw=:pflKz3N+bgPLHDuz8gxf0r bbY+3ymbKnAvcg/qM0YYxPHS5Ki7NzKpqgf34Jv2vskCkP/jNMrSMc0vIRIzqJEO6UQLqhNXJ dAvdugMBkVnywngGmJYnXMvvnzQ1QplYZZSvqIjF4QKj8ntUWj6V58RMin68zetN2d9XjymyS v/VYKbXk2+LKCEarSrV3dxGNkfcstPC4D0lCPQenxYfEUVhbV1x86GZi+9GU7hefFd7WGa8+0 BJTSAk1C7PqbcoceGNPPD/gKPUbDeT1XTr2hOVrvIuOTQQCwaey2Qy+TP9PM5y6OHbYiQfve8 ebYktbo3wlqHw5X9RR1o5gsrmeAY0WFC5ZFMa/wj3pS4f84ZEEApz1KZzwsl241YQnxGquJ0F UP8Lf8qly2y+m4XR2r1lfv02kM7exUiKo9AyWDO/JrBo8i/qGa4Z6F+nyrncq31FJhr9vw3DI rsPxDNNVJbKZlghb7QwF2hdWM9hQAtsWcC/V2TGi6PDypV/bHWy/FeF7xaIpe+VZvU/KZOueB CtBR8756GXUtkIyz+c0h3sCZvg5XNV5ZfI2LZhdz4lOBjvl/XP4l2B6jfWQ9nYBXW4+RfQ5AW OQxizhG8bEhRms2mnK3j7E9Tec0uS+AW1j5pTro2wVeRqBQDFjghfhJfpiaW9W/AtGt5wdP91 Xew3WCbEGcT/18gKxcd+VVX2ZeEbC36VXkl0qNJcreqiX5UWpmYequ+TBkbEEhEb/+niSfyJH Z/xQaOpchVbcHcHLhPSWmEhA7BPg3ipud9PqtA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When CONFIG_BPF is disabled, we get a warning for an unused variable: In file included from drivers/target/target_core_device.c:26: include/net/tcp.h:2226:19: error: unused variable 'tp' [-Werror,-Wunused-variable] struct tcp_sock *tp = tcp_sk(sk); The variable is only used in one place, so it can be replaced with its value there to avoid the warning. Fixes: 23729ff23186 ("bpf: add BPF_CGROUP_SOCK_OPS callback that is executed on every RTT") Signed-off-by: Arnd Bergmann --- include/net/tcp.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) -- 2.20.0 diff --git a/include/net/tcp.h b/include/net/tcp.h index e16d8a3fd3b4..cca3c59b98bf 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -2223,9 +2223,7 @@ static inline bool tcp_bpf_ca_needs_ecn(struct sock *sk) static inline void tcp_bpf_rtt(struct sock *sk) { - struct tcp_sock *tp = tcp_sk(sk); - - if (BPF_SOCK_OPS_TEST_FLAG(tp, BPF_SOCK_OPS_RTT_CB_FLAG)) + if (BPF_SOCK_OPS_TEST_FLAG(tcp_sk(sk), BPF_SOCK_OPS_RTT_CB_FLAG)) tcp_call_bpf(sk, BPF_SOCK_OPS_RTT_CB, 0, NULL); }