lkml.org 
[lkml]   [2018]   [Nov]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] module: make it clearer when we're handling kallsyms symbols vs exported symbols
On Wed, 21 Nov 2018, Jessica Yu wrote:

> The module loader internally works with both exported symbols
> represented as struct kernel_symbol, as well as Elf symbols from a
> module's symbol table. It's hard to distinguish sometimes which type of
> symbol we're handling given that some helper function names are not
> consistent or helpful. Take get_ksymbol() for instance - are we
> looking for an exported symbol or a kallsyms symbol here? Or symname()
> and kernel_symbol_name() - which function handles an exported symbol and
> which one an Elf symbol?
>
> Clean up and unify the function naming scheme a bit to make it clear
> which kind of symbol we're handling. This change only affects static
> functions internal to the module loader.
>
> Signed-off-by: Jessica Yu <jeyu@kernel.org>

Great. It should help a lot. Pity we cannot rename find_symbol() as well.

I have only a naming nit. I think it is nice to have
<verb>_exported_<noun> convention. New kallsyms_ names don't hold it
though. Wouldn't it be better to be consistent and have
find_kallsyms_symbol() instead of kallsyms_find_symbol()? Or we could do
the opposite and have a "namespace" prefix first. That is,
exported_<verb>_<noun>. However, I don't like it that much.

To be honest, your approach may be the best in the end.

What do you think?

Regards,
Miroslav

\
 
 \ /
  Last update: 2018-11-22 11:20    [W:0.033 / U:1.204 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site