Re: [PATCH v8] livepatch: Clear relocation targets on a module removal

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

 



> > >
> > > > +int klp_apply_section_relocs(struct module *pmod, Elf_Shdr *sechdrs,
> > > > +                          const char *shstrtab, const char *strtab,
> > > > +                          unsigned int symndx, unsigned int secndx,
> > > > +                          const char *objname)
> > > > +{
> > > > +     return klp_write_section_relocs(pmod, sechdrs, shstrtab, strtab, symndx,
> > > > +                                     secndx, objname, true);
> > > >  }
> 
> I think that I proposed this wrapper :-)
> 
> > > Is this redirection needed somewhere? You could just replace
> > > klp_apply_section_relocs() with klp_write_section_relocs() in
> > > include/linux/livepatch.h and kernel/module/main.c.
> > >
> > > It may be cleaned up later.
> > 
> > It might be a good practice to keep _write_ static in this file, and
> > only expose _apply_ (maybe also _clear_ in the future)?
> 
> And I think that this was the reason. Also it looks better in
> kernel/module/main.c in apply_relocations() that calls few more
> *_apply_*reloc*() functions.
> 
> The idea is that functions with the same naming pattern do
> the same operation. Also it is supposed to hide the true/false
> parameter and self-explain the meaning by the function name.
> 
> 
> > I don't have a strong preference either way.
> 
> I would prefer to keep the wrapper. But I do not resist on it :-)

Ok, fair enough. Let's keep it then.

Miroslav



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux Kernel]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux