linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Wangnan (F)" <wangnan0@huawei.com>
To: "Mickaël Salaün" <mic@digikod.net>, linux-kernel@vger.kernel.org
Cc: Alexei Starovoitov <ast@fb.com>,
	Daniel Borkmann <daniel@iogearbox.net>,
	"David S . Miller" <davem@davemloft.net>,
	<netdev@vger.kernel.org>
Subject: Re: [PATCH net-next v1] bpf: Remove redundant ifdef
Date: Mon, 13 Feb 2017 09:53:49 +0800	[thread overview]
Message-ID: <f83892da-d672-8bf7-18e4-85de21deea84@huawei.com> (raw)
In-Reply-To: <20170211193708.18191-1-mic@digikod.net>



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 <mic@digikod.net>
> Cc: Alexei Starovoitov <ast@fb.com>
> Cc: Daniel Borkmann <daniel@iogearbox.net>
> Cc: David S. Miller <davem@davemloft.net>
> Cc: Wang Nan <wangnan0@huawei.com>
> 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 <wangnan0@huawei.com>

However, it is better to merge this patch with commit 
702498a1426bc95b6f49f9c5fba616110cbd3947.

Thank you.

  reply	other threads:[~2017-02-13  1:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-11 19:37 [PATCH net-next v1] bpf: Remove redundant ifdef Mickaël Salaün
2017-02-13  1:53 ` Wangnan (F) [this message]
2017-02-14 17:07   ` David Miller
2017-02-15  0:52     ` Wangnan (F)
2017-02-15 17:15 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f83892da-d672-8bf7-18e4-85de21deea84@huawei.com \
    --to=wangnan0@huawei.com \
    --cc=ast@fb.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mic@digikod.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).