[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAK7LNAR_-2rpXDk_ago9_6au8rWZMBvkzZtS4Oq75n+8CF9_iA@mail.gmail.com>
Date: Sat, 31 May 2025 22:59:24 +0900
From: Masahiro Yamada <masahiroy@...nel.org>
To: Petr Pavlu <petr.pavlu@...e.com>
Cc: Nathan Chancellor <nathan@...nel.org>, Nicolas Schier <nicolas@...sle.eu>, linux-kbuild@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] genksyms: Fix enum consts from a reference affecting new values
On Tue, May 27, 2025 at 11:23 PM Petr Pavlu <petr.pavlu@...e.com> wrote:
> @@ -225,6 +221,23 @@ static struct symbol *__add_symbol(const char *name, enum symbol_type type,
> return NULL;
> }
>
> + return defn;
> +}
> +
> +static struct symbol *__add_symbol(const char *name, enum symbol_type type,
> + struct string_list *defn, int is_extern,
> + int is_reference)
> +{
> + unsigned long h;
> + struct symbol *sym;
> + enum symbol_status status = STATUS_UNCHANGED;
> +
> + if ((type == SYM_ENUM_CONST || type == SYM_ENUM) && !is_reference) {
> + defn = process_enum(name, type, defn);
process_enum() is only called when type is SYM_ENUM_CONST
or SYM_ENUM.
process_enum()
{
if (type == SYM_ENUM_CONST) {
...
} else if (type == SYM_ENUM) {
...
}
}
can be sampled into:
process_enum()
{
if (type == SYM_ENUM_CONST) {
...
} else {
...
}
}
The other parts look good to me.
> + if (defn == NULL)
> + return NULL;
> + }
> +
> h = crc32(name);
> hash_for_each_possible(symbol_hashtable, sym, hnode, h) {
> if (map_to_ns(sym->type) != map_to_ns(type) ||
>
> base-commit: 914873bc7df913db988284876c16257e6ab772c6
> --
> 2.43.0
>
--
Best Regards
Masahiro Yamada
Powered by blists - more mailing lists