From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4313DC4332D for ; Fri, 20 Mar 2020 02:33:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 12A9D2051A for ; Fri, 20 Mar 2020 02:33:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727049AbgCTCdW (ORCPT ); Thu, 19 Mar 2020 22:33:22 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:33404 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726666AbgCTCdV (ORCPT ); Thu, 19 Mar 2020 22:33:21 -0400 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id BAFFA24877BE96986CAF; Fri, 20 Mar 2020 10:33:14 +0800 (CST) Received: from [127.0.0.1] (10.173.223.234) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.487.0; Fri, 20 Mar 2020 10:33:13 +0800 Subject: Re: [PATCH bpf-next] bpf: tcp: Fix unused function warnings To: Jakub Sitnicki References: <20200319124631.58432-1-yuehaibing@huawei.com> <87fte4xot3.fsf@cloudflare.com> CC: , , , , , , From: Yuehaibing Message-ID: Date: Fri, 20 Mar 2020 10:33:12 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <87fte4xot3.fsf@cloudflare.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.173.223.234] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/3/20 1:00, Jakub Sitnicki wrote: > On Thu, Mar 19, 2020 at 01:46 PM CET, YueHaibing wrote: >> If BPF_STREAM_PARSER is not set, gcc warns: >> >> net/ipv4/tcp_bpf.c:483:12: warning: 'tcp_bpf_sendpage' defined but not used [-Wunused-function] >> net/ipv4/tcp_bpf.c:395:12: warning: 'tcp_bpf_sendmsg' defined but not used [-Wunused-function] >> net/ipv4/tcp_bpf.c:13:13: warning: 'tcp_bpf_stream_read' defined but not used [-Wunused-function] >> >> Moves the unused functions into the #ifdef >> >> Reported-by: Hulk Robot >> Signed-off-by: YueHaibing >> --- > > In addition to this fix, looks like tcp_bpf_recvmsg can be static and > also conditional on CONFIG_BPF_STREAM_PARSER. Thanks, will do this in next version. > > Reviewed-by: Jakub Sitnicki > > . >