On 8/12/26 5:28 AM, Tiezhu Yang wrote:
> Currently, the loops in layout_symtab() and add_kallsyms() duplicate the
> exact same checks (i == 0 || is_livepatch_module() || is_core_symbol())
> to determine whether a symbol should be preserved in the module's core
> symbol table.
> 
> Rename is_core_symbol() to is_kept_symbol() and move the entire checking
> logic inside it, including the special handlers for the first symbol and
> livepatch modules.
> 
> No functional change.
> 
> Suggested-by: Petr Pavlu <[email protected]>
> Signed-off-by: Tiezhu Yang <[email protected]>

Looks ok to me. I'm also fine also keeping the current name,
is_core_symbol(), as Huacai mentions in his review [1]. I previously
suggested is_kept_symbol() [2], since the is_livepatch_module() check
is moved into this function. However, is_core_symbol() is still ok, as
it is consistent with where the symbols are assigned, in
module::core_kallsyms.

The important part is to avoid duplicating the checks that determine
whether a symbol should be kept in layout_symtab() and add_kallsyms().

Reviewed-by: Petr Pavlu <[email protected]>

[1] 
https://lore.kernel.org/linux-modules/caahv-h5w8vvw_l6cres-syjevhbwmevskwrzwpfaprkuemm...@mail.gmail.com/
[2] 
https://lore.kernel.org/linux-modules/[email protected]/

-- 
Thanks,
Petr

Reply via email to