[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAADnVQJ2+m4DVGpBQ_0a+vGDSodRqfpFhWzw1umEf_ytyY7kVw@mail.gmail.com>
Date: Wed, 17 Mar 2021 11:15:53 -0700
From: Alexei Starovoitov <alexei.starovoitov@...il.com>
To: Andrii Nakryiko <andrii.nakryiko@...il.com>
Cc: Andrii Nakryiko <andrii@...nel.org>, bpf <bpf@...r.kernel.org>,
Networking <netdev@...r.kernel.org>,
Alexei Starovoitov <ast@...com>,
Daniel Borkmann <daniel@...earbox.net>,
Kernel Team <kernel-team@...com>
Subject: Re: [PATCH v2 bpf-next 1/4] bpftool: generate NULL definition in vmlinux.h
On Wed, Mar 17, 2021 at 10:38 AM Andrii Nakryiko
<andrii.nakryiko@...il.com> wrote:
> > diff --git a/tools/bpf/bpftool/btf.c b/tools/bpf/bpftool/btf.c
> > index 62953bbf68b4..ff6a76632873 100644
> > --- a/tools/bpf/bpftool/btf.c
> > +++ b/tools/bpf/bpftool/btf.c
> > @@ -405,6 +405,8 @@ static int dump_btf_c(const struct btf *btf,
> > printf("#ifndef __VMLINUX_H__\n");
> > printf("#define __VMLINUX_H__\n");
> > printf("\n");
> > + printf("#define NULL ((void *)0)\n");
>
>
> On second thought, this could also be done in bpf_helpers.h, which is
> pretty much always included in BPF programs. I think that's a bit more
> maintainable and less magical to users, so I'll go with that in v3.
yep. good idea.
Powered by blists - more mailing lists