From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751509AbdBOAye (ORCPT ); Tue, 14 Feb 2017 19:54:34 -0500 Received: from szxga02-in.huawei.com ([119.145.14.65]:41948 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750905AbdBOAxP (ORCPT ); Tue, 14 Feb 2017 19:53:15 -0500 Subject: Re: [PATCH net-next v1] bpf: Remove redundant ifdef To: David Miller References: <20170211193708.18191-1-mic@digikod.net> <20170214.120743.1600921739599827036.davem@davemloft.net> CC: , , , , From: "Wangnan (F)" Message-ID: Date: Wed, 15 Feb 2017 08:52:48 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <20170214.120743.1600921739599827036.davem@davemloft.net> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.111.194.139] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020204.58A3A669.00AB,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 589061243e451bf2256a5931fb88cdb4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2017/2/15 1:07, David Miller wrote: > From: "Wangnan (F)" > Date: Mon, 13 Feb 2017 09:53:49 +0800 > >> >> On 2017/2/12 3:37, Mickaël Salaün wrote: >>> Remove a useless ifdef __NR_bpf as requested by Wang Nan. >>> >>> Inline one-line static functions as it was in the bpf_sys.h file. >>> >>> Signed-off-by: Mickaël Salaün >>> Cc: Alexei Starovoitov >>> Cc: Daniel Borkmann >>> Cc: David S. Miller >>> Cc: Wang Nan >>> Link: >>> https://lkml.kernel.org/r/828ab1ff-4dcf-53ff-c97b-074adb895006@huawei.com >>> --- >>> tools/lib/bpf/bpf.c | 12 +++--------- >>> 1 file changed, 3 insertions(+), 9 deletions(-) >>> >>> diff --git a/tools/lib/bpf/bpf.c b/tools/lib/bpf/bpf.c >>> index 50e04cc5dddd..2de9c386989a 100644 >>> --- a/tools/lib/bpf/bpf.c >>> +++ b/tools/lib/bpf/bpf.c >>> @@ -42,21 +42,15 @@ >>> # endif >>> #endif >>> -static __u64 ptr_to_u64(const void *ptr) >>> +static inline __u64 ptr_to_u64(const void *ptr) >>> { >>> return (__u64) (unsigned long) ptr; >>> } >>> -static int sys_bpf(enum bpf_cmd cmd, union bpf_attr *attr, >>> - unsigned int size) >>> +static inline int sys_bpf(enum bpf_cmd cmd, union bpf_attr *attr, >>> + unsigned int size) >>> { >>> -#ifdef __NR_bpf >>> return syscall(__NR_bpf, cmd, attr, size); >>> -#else >>> - fprintf(stderr, "No bpf syscall, kernel headers too old?\n"); >>> - errno = ENOSYS; >>> - return -1; >>> -#endif >>> } >>> int bpf_create_map(enum bpf_map_type map_type, int key_size, >> Acked-by: Wang Nan >> >> However, it is better to merge this patch with commit >> 702498a1426bc95b6f49f9c5fba616110cbd3947. > I don't know where this commit ID is. Since this patch is targetting > net-next I would expect a commit ID with not context to be in that > tree. Please always specify where the commit ID you mention is. It is "bpf: Remove bpf_sys.h from selftests" in net-next. > Futhermore, commits in net-next are permanent so it is not possible > afterwards to "merge this patch with commit X". I understand. Maintainers sometime reset his/her head to an early version and amend the commit to make the history clean, but clearly net-next never do this. Thank you.