Re: [PATCH] kallsyms: Fix kallsyms_selftest failure

From: Nick Desaulniers
Date: Fri Aug 25 2023 - 13:52:48 EST


On Thu, Aug 24, 2023 at 8:49 PM Yonghong Song <yonghong.song@xxxxxxxxx> wrote:
>
> diff --git a/kernel/kallsyms.c b/kernel/kallsyms.c
> index 016d997131d4..e12d26c10dba 100644
> --- a/kernel/kallsyms.c
> +++ b/kernel/kallsyms.c
> @@ -188,16 +188,13 @@ static bool cleanup_symbol_name(char *s)
>
> static int compare_symbol_name(const char *name, char *namebuf)
> {
> - int ret;
> -
> - ret = strcmp(name, namebuf);
> - if (!ret)
> - return ret;
> -
> - if (cleanup_symbol_name(namebuf) && !strcmp(name, namebuf))
> - return 0;
> -
> - return ret;
> + /* The kallsyms_seqs_of_names is sorted based on names after
> + * cleanup_symbol_name() (see scripts/kallsyms.c) if clang lto is enabled.
> + * To ensure correct bisection in kallsyms_lookup_names(), do
> + * cleanup_symbol_name(namebuf) before comparing name and namebuf.
> + */
> + cleanup_symbol_name(namebuf);

Hi Yonghong,
Thanks for your work on this patch.
So if this change is removing the last place where the return value of
cleanup_symbol_name is checked, then perhaps this commit should
additionally change the function signature of cleanup_symbol_name to
have `void` return type.

--
Thanks,
~Nick Desaulniers