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]

 



On Thu, Dec 5, 2024 at 9:23 AM Alastair Robertson <ajor@xxxxxxxx> wrote:
>
> > >  {
> > > -       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?
>

yep, if they are unreasonable :) checkpatch.pl is a guidance, not the
final authority

>
> > > +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.

but memfd_create() is an internal implementation detail, so let's not
leak that into public API

>
> 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