On Mon, Jun 29, 2020 at 8:09 PM Alexei Starovoitov <alexei.starovoitov@xxxxxxxxx> wrote: > > On Mon, Jun 29, 2020 at 07:05:38PM -0700, Andrii Nakryiko wrote: > > Copy over few #defines from UAPI swab.h header to make all the rest of > > bpf_endian.h work and not rely on any extra headers. This way it can be used > > both with linux header includes, as well with a vmlinux.h. This has been > > a frequent complaint from users, that need this header. > > > > Signed-off-by: Andrii Nakryiko <andriin@xxxxxx> > > --- > > tools/lib/bpf/bpf_endian.h | 22 ++++++++++++++++++++-- > > 1 file changed, 20 insertions(+), 2 deletions(-) > > > > diff --git a/tools/lib/bpf/bpf_endian.h b/tools/lib/bpf/bpf_endian.h > > index fbe28008450f..a4be8a70845c 100644 > > --- a/tools/lib/bpf/bpf_endian.h > > +++ b/tools/lib/bpf/bpf_endian.h > > @@ -2,8 +2,26 @@ > > #ifndef __BPF_ENDIAN__ > > #define __BPF_ENDIAN__ > > > > -#include <linux/stddef.h> > > -#include <linux/swab.h> > > +/* copied from include/uapi/linux/swab.h */ > > You cannot just copy due to different licenses. Ah, I see. I was thinking that because it's from UAPI header it might be ok. Alright, I'll try to re-implement it instead.