Received: by 2002:a17:90a:1609:0:0:0:0 with SMTP id n9csp2512976pja; Thu, 26 Mar 2020 16:55:06 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsVvBbntczA6s1+sLRvY0et/2KzlKyZ+s2XcQ27DQWZk3OAnVDuAGR50WjYX7LpUKH4zoAV X-Received: by 2002:aca:bac1:: with SMTP id k184mr2220054oif.157.1585266906682; Thu, 26 Mar 2020 16:55:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585266906; cv=none; d=google.com; s=arc-20160816; b=EgP3V0kWwYU2xkaCkR+/9t8PKsAPbmqXpzmW4Wls22Yhw82LWqE52R7D5sY26gelQ+ PTP5LKo8nOrITnQ+WGzGuIRirqUsQ9axyubzkAQLYoo0Nl/FA/bsycVqvL8wT9PTPfLC a6BHwZVVpO7pSYdaGCLPOVtB9hNGS0/vTNbeikae6PYFB5gO9YnYn7klOQItWBWk83+2 y5zBVJtz4iTO/xcO/2Nip1r/9MmvLI9pogpxy54iQ36OmI0hoBrf9J/Jkque2+bojdVT y0TNdw/r3OO/JHLoNERJjWAs2jjA8VKmdYnOOX9FXDaw/ZBgknb+DspHrPIo3zxQIuJT bYkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=7CVUJ19v0pY389uYsPOimGpmTd+8zgk3ZoECLlak5lM=; b=s5TUt7pWK82jwSeb6LZ/W+aJkDAT+/qT7h2E2UnkSHoWVO63U2W5Tk7VX5uL0UfJgq oiPLIv5ddw31IaQGpCXglOiynSC92TD/xX7xNZ8xfAtXNCvmOTqf3uP/PfZ1Xwe9t9T1 g3ZWiib0ti7U6XyQ4osGGz7EsBmU43YETsMLXXjmHueGXkEp6zD9gz7W6VDWnT5Gh4pY PVTmkTqQYjozKwgsU3baiICPF3dIXw+x5kgiQ212WUe6UeC9mkFiuupxfh6cQxGeilW1 PE+TY+B1uO8Pts8reutbwpfD7v8HMCi9CZZMXb/DV/NIG8kugdmicBV4PF/nfcGVDV5V xZFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=INFMJGFc; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w31si1637009otb.59.2020.03.26.16.54.54; Thu, 26 Mar 2020 16:55:06 -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=@gmail.com header.s=20161025 header.b=INFMJGFc; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727701AbgCZXyc (ORCPT + 99 others); Thu, 26 Mar 2020 19:54:32 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:38488 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726067AbgCZXyc (ORCPT ); Thu, 26 Mar 2020 19:54:32 -0400 Received: by mail-pg1-f196.google.com with SMTP id x7so3705602pgh.5; Thu, 26 Mar 2020 16:54:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=7CVUJ19v0pY389uYsPOimGpmTd+8zgk3ZoECLlak5lM=; b=INFMJGFcMVQGmxapcKuRntC2Hu7Scihi/K2WIqPinYkE7x1TAkiXXc/d9BNnWaPns4 L5Yjl1/AowBiF15atWfviywBhgO0UTCApRKD1MEGRqOaNjJrO5D5tVfDDz4cE2trvw7l bVlE0Rmf+Rh4whilo56Bl9iTZHvA/Je7qZtsq+R12rNvESruWl2DpeWOyGkOP8bTUtJl /o2zXLz1MMGyJ7Kxl3bLSSodp3GyaoJKNprYHm99xSQEbaB3llKIkqNDETYReSsVx9nE FnvPXwu9d7nsGvcDwKRbA8+6i5NN5ibUQbL2vPleW6nU335BCJvH52SJ0grrfZk7KwSi 8EvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=7CVUJ19v0pY389uYsPOimGpmTd+8zgk3ZoECLlak5lM=; b=WODTFPEOQnnMYBo9VCxkSA5i0evU3VthziUjDUZg9HUk6iR90FQZScpW/IQHZg/z6p Pr+D5TiiAZGmq4ptlNOjqwfDdh5iUHFowZumTujom0Z15ApS+6iqYrg9CuLa7I+KIS9o wnl1SzQOmmmK/jKI/AjZBKhNC7uL7BJJm+G4e2oe1uaGpRaU/8zGJM/cKRiB0WcXvn2M NB0+m//El3bn13q+8lnbdSmGXB6ZVqHNtec2HhrZmRH0sGL/YoNh40THmareWlau5xUB yIKGCD6Gv/MwyQxM5HbMNs3iX3exjExLe4wMya74QdS2YmT3DNTTxo5tVtJAyGjvshGq 8bkg== X-Gm-Message-State: ANhLgQ15N5sneQW/xMREsldks7Ms6CIYwaNux0ZMcDi5czpyLJ3LUibf frirDRhqZOvZR3fBpx5MXok= X-Received: by 2002:a63:1517:: with SMTP id v23mr10800809pgl.89.1585266871010; Thu, 26 Mar 2020 16:54:31 -0700 (PDT) Received: from ast-mbp ([2620:10d:c090:400::5:c7d9]) by smtp.gmail.com with ESMTPSA id p70sm2417463pjp.47.2020.03.26.16.54.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2020 16:54:30 -0700 (PDT) Date: Thu, 26 Mar 2020 16:54:26 -0700 From: Alexei Starovoitov To: Jean-Philippe Menil Cc: yhs@fb.com, kernel-janitors@vger.kernel.org, "David S. Miller" , Jakub Kicinski , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Andrii Nakryiko , netdev@vger.kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] bpf: fix build warning - missing prototype Message-ID: <20200326235426.ei6ae2z5ek6uq3tt@ast-mbp> References: <7c27e51f-6a64-7374-b705-450cad42146c@fb.com> <20200324072231.5780-1-jpmenil@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200324072231.5780-1-jpmenil@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 24, 2020 at 08:22:31AM +0100, Jean-Philippe Menil wrote: > Fix build warnings when building net/bpf/test_run.o with W=1 due > to missing prototype for bpf_fentry_test{1..6}. > > Declare prototypes in order to silence warnings. > > Signed-off-by: Jean-Philippe Menil > --- > net/bpf/test_run.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/net/bpf/test_run.c b/net/bpf/test_run.c > index d555c0d8657d..cdf87fb0b6eb 100644 > --- a/net/bpf/test_run.c > +++ b/net/bpf/test_run.c > @@ -113,31 +113,37 @@ static int bpf_test_finish(const union bpf_attr *kattr, > * architecture dependent calling conventions. 7+ can be supported in the > * future. > */ > +int noinline bpf_fentry_test1(int a); > int noinline bpf_fentry_test1(int a) > { > return a + 1; > } > > +int noinline bpf_fentry_test2(int a, u64 b); > int noinline bpf_fentry_test2(int a, u64 b) > { > return a + b; > } > > +int noinline bpf_fentry_test3(char a, int b, u64 c); > int noinline bpf_fentry_test3(char a, int b, u64 c) > { > return a + b + c; > } > > +int noinline bpf_fentry_test4(void *a, char b, int c, u64 d); > int noinline bpf_fentry_test4(void *a, char b, int c, u64 d) > { > return (long)a + b + c + d; > } > > +int noinline bpf_fentry_test5(u64 a, void *b, short c, int d, u64 e); > int noinline bpf_fentry_test5(u64 a, void *b, short c, int d, u64 e) > { > return a + (long)b + c + d + e; > } > > +int noinline bpf_fentry_test6(u64 a, void *b, short c, int d, void *e, u64 f); > int noinline bpf_fentry_test6(u64 a, void *b, short c, int d, void *e, u64 f) That's a bit too much of "watery water". Have you considered __diag_push(); __diag_ignore(GCC, "-Wwhatever specific flag will shut up this warn") __diag_pop(); approach ? It will be self documenting as well.