Received: by 2002:a25:d783:0:0:0:0:0 with SMTP id o125csp861759ybg; Thu, 19 Mar 2020 10:02:51 -0700 (PDT) X-Google-Smtp-Source: ADFU+vul2mQCpJZNjhRfyTic9Zv3p50AAluYMzQAzWYNt7da6b2VAaA7cJF54K8jYij+RDAU5A3r X-Received: by 2002:a05:6830:2391:: with SMTP id l17mr3244591ots.339.1584637371403; Thu, 19 Mar 2020 10:02:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584637371; cv=none; d=google.com; s=arc-20160816; b=0lMy8VOhpclLSkNoGVDG2YV3c7zLBojNdf5KlUKMu00PGwE60k19yAyVDKR1VFj5mj 023cyOJn2ti44/c18cZNNcAenqzAHs+HmTh/VBFc4M/MNzUsNgumLluhBEWxM+fytp7A xsELSlXsg074o2LjPFCmlap1Y2OezKQhenhpguUxidhrB35PruH6d357VzKDcL+tFiJs Un8y9cypyuXcHa6aIsb4eNjh65zS8kJhk4Acfw1Mi09wr9Bz/exr3TIfaW4DeFGymHPt +MHSwPPnc6ehPAqiYadvnQxsj9ZK/rptNizhSzPICq0OZgxpPee3MkVJZVgR5JGvfii1 WNgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:in-reply-to :subject:cc:to:from:user-agent:references:dkim-signature; bh=vtMkzIwErSV95ddMs8+z368iZRh2IGDxPAeyTBG0cRU=; b=WZISXs+DyVpzK88anheoZUKSMpZSw/0TFCDU3S8KFuILbEA/hWTba+hMB596UHcZ8W MHJV5ATonsQEAx1mgMyA6XFHCvo3H4PzH/V+TAMmGBLv83zw61OkBY07MgF+juLEUDxN Bwvye38yzf4MAIdk/o6Rec09IPa32gqpCatBi9ou1wda4D/piibmRi5ACKxKPsJVWEOt /vqEWyILbSMujS2H2QAuHlVku7wA8I2w4UzbNYaz1gaD2nvi8uPc8im/1i+ma/ibmS7y E6zuvxuAB26uZLp9gdTc4FNPhiJaQ6JRueLSQVVaKKgUEWWWfH4KH+jG0BPLoBqeEu+y SKMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cloudflare.com header.s=google header.b=DWnpDyFy; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=cloudflare.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1si1370302ois.18.2020.03.19.10.02.24; Thu, 19 Mar 2020 10:02:51 -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=@cloudflare.com header.s=google header.b=DWnpDyFy; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=cloudflare.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728274AbgCSRA3 (ORCPT + 99 others); Thu, 19 Mar 2020 13:00:29 -0400 Received: from mail-lf1-f66.google.com ([209.85.167.66]:37008 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727994AbgCSRA3 (ORCPT ); Thu, 19 Mar 2020 13:00:29 -0400 Received: by mail-lf1-f66.google.com with SMTP id j11so2241733lfg.4 for ; Thu, 19 Mar 2020 10:00:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloudflare.com; s=google; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=vtMkzIwErSV95ddMs8+z368iZRh2IGDxPAeyTBG0cRU=; b=DWnpDyFyEjuHzu+kRPx00hpMuT06IvaqqLSwmamJaN9ZNBGgnTK9dVYcoEswiuB9so 2zppWBUEL5zX+7W7st4WJ9jc3k2T6d1kDdTytPDB8t+kMIV2ZJyj2IlkTO7DLiPxOiGx yRxuE+k07s8wSpC/DdTrKGRVHg8PluVX0yNT0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=vtMkzIwErSV95ddMs8+z368iZRh2IGDxPAeyTBG0cRU=; b=Vk/VV/QK5King34npSOY5K7O/GZM+6EKfIO4uCIP8SDcNMEkPCnyg+V+V1KMkaNXD0 kKFsdJhD8KId2TdL+NzYGK1M3SisiXCxKph0qUsAf794p0+ilii8h1X+DP7ctRZe/2Bf PK8ncVPprtLY3mx6WHZb3hycePzDW7/w8D66FUp/oDwP8eDzeLhRDMQMBbI+jgf76afQ xLhEmDcA2EgR15JSQQBZEUmwbwvhfVzUiJeECemHmNRPbexpFy8dg4Tn+S78HHIgpmnV w2H6RRMquSINhHHEQmIBVZ+TKudQgWV8yhFiwGYv4T7b8Qjzley48lXWIgD+s/ggkQND dXzA== X-Gm-Message-State: ANhLgQ3TggolYDUPKEta0JInwE8o7BtVVCMyQ83AmuXunWeQ5tLtCWUi LTV7b7+lL8u9tSd73pXOhY6BCw== X-Received: by 2002:a05:6512:6cd:: with SMTP id u13mr2791061lff.1.1584637226598; Thu, 19 Mar 2020 10:00:26 -0700 (PDT) Received: from cloudflare.com ([2a02:a310:c262:aa00:b35e:8938:2c2a:ba8b]) by smtp.gmail.com with ESMTPSA id 64sm1793944ljj.41.2020.03.19.10.00.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Mar 2020 10:00:25 -0700 (PDT) References: <20200319124631.58432-1-yuehaibing@huawei.com> User-agent: mu4e 1.1.0; emacs 26.3 From: Jakub Sitnicki To: YueHaibing Cc: lmb@cloudflare.com, daniel@iogearbox.net, john.fastabend@gmail.com, davem@davemloft.net, netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH bpf-next] bpf: tcp: Fix unused function warnings In-reply-to: <20200319124631.58432-1-yuehaibing@huawei.com> Date: Thu, 19 Mar 2020 18:00:24 +0100 Message-ID: <87fte4xot3.fsf@cloudflare.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Reviewed-by: Jakub Sitnicki