Re: [PATCH bpf-next v2 2/2] libbpf: Extend linker API to support in-memory ELF files

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

 



> >  {
> > -       struct src_obj obj =3D {};
> > -       int err =3D 0, fd;
> > +       int fd, ret;
> >
> > -       if (!OPTS_VALID(opts, bpf_linker_file_opts))
> > -               return libbpf_err(-EINVAL);
> > +       LIBBPF_OPTS(bpf_linker_file_opts, opts);
> 
> this is a variable declaration, no empty lines between variable declaration=
> s

I'd originally written it without the extra empty line but got complaints from
checkpatch.pl. Is it ok to just ignore its warnings?


> > +int bpf_linker__add_buf(struct bpf_linker *linker, const char *name,
> 
> why is the buffer name passed as an argument instead of through
> opts.filename? let's keep it simple and consistent
> 
> and if user didn't care to pass opts.filename, just do some
> "mem:%p+%zu", buf, buf_sz thing

Just because memfd_create() requires a filename so I was treating it as a
required argument for this function too. Happy to change it to this
suggestion though.

All other comments make sense and I'll address them in the next patch.





[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