Re: [PATCH v2 bpf-next 1/4] bpftool: generate NULL definition in vmlinux.h

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Mar 17, 2021 at 10:38 AM Andrii Nakryiko
<andrii.nakryiko@xxxxxxxxx> 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.



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux