From patchwork Fri Sep 7 12:50:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Anders Roxell X-Patchwork-Id: 146209 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp1133855ljw; Fri, 7 Sep 2018 05:50:23 -0700 (PDT) X-Google-Smtp-Source: ANB0Vda622itZiWB/7wCUeJ/MKYb1IXqAhFeGl9pa792gi6vEScrFZUU7PJ+SQsOwT6WxQ5GquCc X-Received: by 2002:a63:2150:: with SMTP id s16-v6mr8041517pgm.267.1536324623851; Fri, 07 Sep 2018 05:50:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536324623; cv=none; d=google.com; s=arc-20160816; b=IkFQUKhB93JjPskJbOgv2TlYa+OSXt8SenzP7YokMMKMWbClaNV5W9mFK5vOHOllmm 1/VY7fUAnpopEfgDrY4RAKpwdushiZwj6e5Wl0kfDPp4LSDHFisq5CgaUET4T1Vr1D1l m6OXp4NBuAP2vwhWO+5ZFqPy3xY6c4Za7ANPGnpD9v4GQKgA5s8y2QWArbz/JyO/t5wU rFDk8LtwVFtGqRGUnU26UDJ3eBJ1ceJKKw+30KrBBZWQeBCcty1Wv6vTZzBEfGlN8DdT nNk8V/NF4TLO4HO6naH18XUtqH9pNBxJQ7NbfTVwO//Go1h3OJASZesHHYAQYCbNe4Z1 T6dw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=WjJqIo2V9tulakXDU1vfB5XIkmIeLndvv4RgJPCzB8w=; b=Xuos0nhA4vEHSWVJbx6MWOBb9x3SAQ5uQ1xkeqJ+WWkQ0DO3Nh8sqSwTRey0Fq3Gmy /i1vypVJR7gGq1PEW2QlL9GKY8UO5kxwMCfRguJ1kaSaqdjexY/4p9RLqtdYZbxw/IFq mo/7nA7/nOXSwIipVzhrxSv3+TkyUxQc47lifCUauCl30GnqYtzrK2YcQzcXF06WDmgD /RhklukT9pWclFc4FPr6Hv2dUPVbgoyPwOLWbOkh8Z+zOogkl+nRNSs7PzGvX/Xn1MEH QBaubX0dG8veAyqmMkuM9X+RPj6nC1gUvf+HZgx0S9W5nnliv0GCvfusJ6ZzY4DTqCmS gqQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Fvwwiw5D; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 184-v6si7898322pgj.421.2018.09.07.05.50.23; Fri, 07 Sep 2018 05:50:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Fvwwiw5D; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727939AbeIGRbJ (ORCPT + 10 others); Fri, 7 Sep 2018 13:31:09 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:47015 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727724AbeIGRbJ (ORCPT ); Fri, 7 Sep 2018 13:31:09 -0400 Received: by mail-lj1-f193.google.com with SMTP id 203-v6so12149834ljj.13 for ; Fri, 07 Sep 2018 05:50:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=WjJqIo2V9tulakXDU1vfB5XIkmIeLndvv4RgJPCzB8w=; b=Fvwwiw5Dppw/bW4cvsyVrBgVYHlIcros3B2Jiq3Lyzesw4AbMZJ7mqI4YTgGs4qWFD ojCQxjqP7aLZVFtA4XYZPYZPfjX8Nc7FjydzS5bAX1oEO3ZwlXNUmfMwJK8SVv63icNv 9W/N7GApDGlFL8yO65UsBOAXAsr89EUaHF7BE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=WjJqIo2V9tulakXDU1vfB5XIkmIeLndvv4RgJPCzB8w=; b=YBfLk684GT1j6D26Li7RY8g2vTHZLvXXHA4LecbRxAMVCXDTG0RFtAUQdQkJYRwA/X iFoObaay7iBOQlCzRmQdwYnd1aDNqaadXn7+lkZLO1nE/nIwLOUorDByXygHPLrJJvlf aYzQkJFsuAycTCzK9ocjBaahL4djeb5VLpw3ML5ElgEtuOMPQVcDHEmVsJ6gLIYnn3th tWVofNnCJ1umUgf820T+LAn5AEc0K4y5iFZ4Ec+E9V7UFAVRcUk+wZr1titVv8C6sG8b eP0KH3EH9CnuEm/cNwHZ6J0gjgGkneQAH4TAue2CY+YB80GL1XyUFVMSWq/bGlx3fd0i ptKA== X-Gm-Message-State: APzg51DHuwx60mUOgXUceHuimp4ytdFOl7b4ce5svQCTmKhNKmq7iN4t uytDWcBZ9T6qCrE/4lG3uusAAw== X-Received: by 2002:a2e:9698:: with SMTP id q24-v6mr4088958lji.35.1536324619273; Fri, 07 Sep 2018 05:50:19 -0700 (PDT) Received: from localhost (c-732171d5.07-21-73746f28.bbcust.telenor.se. [213.113.33.115]) by smtp.gmail.com with ESMTPSA id v63-v6sm1291957lje.20.2018.09.07.05.50.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 07 Sep 2018 05:50:18 -0700 (PDT) From: Anders Roxell To: davem@davemloft.net, ast@kernel.org, daniel@iogearbox.net, tehnerd@fb.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Anders Roxell Subject: [PATCH] net/core/filter: fix unused-variable warning Date: Fri, 7 Sep 2018 14:50:05 +0200 Message-Id: <20180907125005.32383-1-anders.roxell@linaro.org> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Building with CONFIG_INET=n will show the warning below: net/core/filter.c: In function ‘____bpf_getsockopt’: net/core/filter.c:4048:19: warning: unused variable ‘tp’ [-Wunused-variable] struct tcp_sock *tp; ^~ net/core/filter.c:4046:31: warning: unused variable ‘icsk’ [-Wunused-variable] struct inet_connection_sock *icsk; ^~~~ Move the variable declarations inside the {} block where they are used. Fixes: 1e215300f138 ("bpf: add TCP_SAVE_SYN/TCP_SAVED_SYN options for bpf_(set|get)sockopt") Signed-off-by: Anders Roxell --- net/core/filter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.18.0 diff --git a/net/core/filter.c b/net/core/filter.c index d301134bca3a..0ae7185b2207 100644 --- a/net/core/filter.c +++ b/net/core/filter.c @@ -4043,14 +4043,14 @@ static const struct bpf_func_proto bpf_setsockopt_proto = { BPF_CALL_5(bpf_getsockopt, struct bpf_sock_ops_kern *, bpf_sock, int, level, int, optname, char *, optval, int, optlen) { - struct inet_connection_sock *icsk; struct sock *sk = bpf_sock->sk; - struct tcp_sock *tp; if (!sk_fullsock(sk)) goto err_clear; #ifdef CONFIG_INET if (level == SOL_TCP && sk->sk_prot->getsockopt == tcp_getsockopt) { + struct inet_connection_sock *icsk; + struct tcp_sock *tp; switch (optname) { case TCP_CONGESTION: icsk = inet_csk(sk);