From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jesper Dangaard Brouer Subject: Re: [PATCH] trace/xdp: fix compile warning: =?UTF-8?B?4oCYc3Ry?= =?UTF-8?B?dWN0IGJwZl9tYXDigJk=?= declared inside parameter list Date: Wed, 29 Nov 2017 15:05:05 +0100 Message-ID: <20171129150505.65d556bb@redhat.com> References: <1511944501-160820-1-git-send-email-xiexiuqi@huawei.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: 'Xie XiuQi' , "rostedt@goodmis.org" , "mingo@redhat.com" , "davem@davemloft.net" , "daniel@iogearbox.net" , "ast@kernel.org" , "kstewart@linuxfoundation.org" , "gregkh@linuxfoundation.org" , "john.fastabend@gmail.com" , "linux-kernel@vger.kernel.org" , "huangdaode@hisilicon.com" , Hanjun Guo , brouer@redhat.com, "netdev@vger.kernel.org" To: David Laight Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org On Wed, 29 Nov 2017 13:49:01 +0000 David Laight wrote: > From: Xie XiuQi > > Sent: 29 November 2017 08:35 > > > > We meet this compile warning, which caused by missing bpf.h in xdp.h. > > > > In file included from ./include/trace/events/xdp.h:10:0, > > from ./include/linux/bpf_trace.h:6, > > from drivers/net/ethernet/intel/i40e/i40e_txrx.c:29: > > ./include/trace/events/xdp.h:93:17: warning: struct bpf_map declared inside parameter list will not be > > visible outside of this definition or declaration > > const struct bpf_map *map, u32 map_index), > > ^ > ... > > diff --git a/include/trace/events/xdp.h b/include/trace/events/xdp.h > > index 4cd0f05..8989a92 100644 > > --- a/include/trace/events/xdp.h > > +++ b/include/trace/events/xdp.h > > @@ -8,6 +8,7 @@ > > #include > > #include > > #include > > +#include > > Isn't it just enough to add: > struct bpf_map; > before the first prototype instead of pulling in the entire header? Nope, because we deref map->id. -- Best regards, Jesper Dangaard Brouer MSc.CS, Principal Kernel Engineer at Red Hat LinkedIn: http://www.linkedin.com/in/brouer