Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1784968imm; Fri, 7 Sep 2018 06:12:11 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZm8UtLALjLV4ssr1U/swgEBMU0Ur7r0NahqxChofoW+Ec1qr5DvVk/yPOjGRfk/e4AQVlV X-Received: by 2002:a17:902:9a01:: with SMTP id v1-v6mr7869925plp.20.1536325931109; Fri, 07 Sep 2018 06:12:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536325931; cv=none; d=google.com; s=arc-20160816; b=npyt1WZM3TfKb1td1nYMP5wRIBel1oOekFgGnvdTHl6efeV2LXz9BcN3ukuC1Xt/UE xyGKtJVyQpWs1/yXs64M7NRKQKFo55zSJW1QPZHRpRXuwz3gmso/unnBgaazpAGceNGU wZarFwnMUCFsQvGcQinLQyZDC2R75RLAihIG5NbfZZ+OqBT5++BQiw9DXHDZrBhkH+HW YXovcdhIKchH7WNorskuBcwTCJE7Awx1cgyLG6DcsrrtKy82uK90IuRZlemYhbC69xbn Tj89voOjGAFi3bCHaqlrYYENKiOU1+0I5I9NWI+B3/CKML3K5ja8my0j5q7pweoSyLmd 5kAA== 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=0EKCIXV5U0JI+14LLvzoBgCjUdtYoA+oAZNdY6sZwMGe8Xj+dMF5O4lR86KewxFIzr aHeRJko9yO+t1Bp22u2OLLi+1gMcQSfX+3Mm0iM3wDziGN1Df/+dsVgJq5c7Z+M724vN tTeWfYvf0dTr7G0gRbq/mGZ7/kql0oRh0mF14eRNJ3sdZiVLx4iNPNF32C6/w06NTmPh 6mPWGiwQPas+YPJO2C0oH0webu52XAS5LYzeLr1Emq3Y9aZ5Q9zTTSXSBo4R/EeFEFLM LhFJIjd0S02LM8/dvHPfL66485PdDm8ghFLMRKXcEgzlqTCkRKPyR4ci/pMtoXSH5202 M9lA== 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 linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 7-v6si8556010pgq.637.2018.09.07.06.11.54; Fri, 07 Sep 2018 06:12:11 -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; dkim=pass header.i=@linaro.org header.s=google header.b=Fvwwiw5D; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728902AbeIGRbK (ORCPT + 99 others); Fri, 7 Sep 2018 13:31:10 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:43820 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727786AbeIGRbJ (ORCPT ); Fri, 7 Sep 2018 13:31:09 -0400 Received: by mail-lj1-f196.google.com with SMTP id m84-v6so12154662lje.10 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=Fd+cQuuGbXPvvA5ZIq2+af+Cn+aQG9iVWonrHQ3D2CsZrpwHYTvSlWVvJ1Gw6jBcnr GWwKz8yWEh0EjpULAX+0N8N5AAczj9OZvkM1KsOb4A1CffV5q57SOv+LVZvCH75vaeJ9 IrqgbCD+hjfFY4np5ijYI1stec7pC2EOoZiCJfDGPrplN0/DEBzeD9SRt/6mEjSCRUaV e6RUl8EF5MpEnLM/UX5w0iF8VW+9jwZdAxkdg3L7u/1/gfoxFeYb2uj+x71mrkkeOB4j wm2Y0Ew4Nh5kUgeQ23mm9vVKCwZSQrOmDRLBQMBq03bm25mZV41kErLzBKfjOk8lkTgK k0YA== X-Gm-Message-State: APzg51B0SjmjQLbdXrCgLf62qEO9EhDGSNmjQ2GRXHDQsSOPBkw9FNkz qUG1JMwoiCv0TB6tXsGhywZgYQ== 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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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(-) 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); -- 2.18.0