Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2963533imm; Mon, 28 May 2018 21:05:17 -0700 (PDT) X-Google-Smtp-Source: AB8JxZp7mPjzYaFO8E2CeKZ7+vVKSAnLWV2FCi5bIvO34lWp08MNkNdzidA6jk7/w6paPrFDbEq8 X-Received: by 2002:a62:404f:: with SMTP id n76-v6mr15883239pfa.185.1527566717805; Mon, 28 May 2018 21:05:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527566717; cv=none; d=google.com; s=arc-20160816; b=sMJBA2//bhSGtID+xIvB4sa7Vw+/Xd87j02MIHuSaybRSGvjiUmpR3mLNn/wX9aPHj /RbDshZnuk6OYD6EVAkGLutdvCgCyX1PhPa0AAacYjjfwxYWisKfP82NzaiMvADS/IjA IzI9dsmSS65sFa+Zvt8q+ODwLWxdRAfGuasKhKTcjyHudKkirVqfx7iHQ2ZAkmVfIIjq HIWUdSlrDhitUNH9a+oKqB+DzNiF8DgyctZwj/iE/O9KJABq2mrrL695jWrwTKfCPZKd x7j6Na18xc2oyV3k7Yj0vS2hFCQd2bCQIWCoUD7Ysq1L5McvZ5kmr9EBFL7wnQ8akoR8 d1cA== 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:arc-authentication-results; bh=KitqcuGpgo+w//6lGrBS8dwmBpoPgSN53X/RQNZCOEc=; b=b9ywhFB6enJz5yY+k0oYT99BJlA7Ypt8WY+cmJ9KsRJIqp879QdNqCumybE5gCic6l 3NxJkGv5kfwxIFOTZhL9Y7UhSMIsNBxNTZ60ziGNW/fGOS17BqILgLoYAu6OgCqx7snJ fnOxirpbzYgRNJcyiJMxfrfq5hE7P/kJa+nntGyPk/xsCmOl3oZG5rRaY//NZubYS5H1 ojlG6wyrpr4j4bv52rpASPvfAUKLGpZZniyrl5knLAgg8DX/169X5mAMjug3A6kkDE0H BxrVnZ85KL6RSA/XToICV8Aujhuw+rEebOqguLQelz/qSIIxw0tw3G4JxrKHW66qUTlm mudw== 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 t20-v6si24598953pgu.183.2018.05.28.21.05.03; Mon, 28 May 2018 21:05:17 -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 S935481AbeE2ClN (ORCPT + 99 others); Mon, 28 May 2018 22:41:13 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:8158 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751341AbeE2ClL (ORCPT ); Mon, 28 May 2018 22:41:11 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 71999EAF8710D; Tue, 29 May 2018 10:40:58 +0800 (CST) Received: from localhost (10.177.31.96) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.382.0; Tue, 29 May 2018 10:40:52 +0800 From: YueHaibing To: , , CC: , , YueHaibing Subject: [PATCH bpf-next] bpf: hide the unused 'off' variable Date: Tue, 29 May 2018 10:40:18 +0800 Message-ID: <20180529024018.12740-1-yuehaibing@huawei.com> X-Mailer: git-send-email 2.10.2.windows.1 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.177.31.96] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The local variable is only used while CONFIG_IPV6 enabled net/core/filter.c: In function ‘sk_msg_convert_ctx_access’: net/core/filter.c:6489:6: warning: unused variable ‘off’ [-Wunused-variable] int off; ^ This puts it into #ifdef. Fixes: 303def35f64e ("bpf: allow sk_msg programs to read sock fields") Signed-off-by: YueHaibing --- net/core/filter.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/core/filter.c b/net/core/filter.c index 24e6ce8..0ce93ed 100644 --- a/net/core/filter.c +++ b/net/core/filter.c @@ -6486,7 +6486,9 @@ static u32 sk_msg_convert_ctx_access(enum bpf_access_type type, struct bpf_prog *prog, u32 *target_size) { struct bpf_insn *insn = insn_buf; +#if IS_ENABLED(CONFIG_IPV6) int off; +#endif switch (si->off) { case offsetof(struct sk_msg_md, data): -- 2.7.0