[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKwvOdm=m7uZC5p52RZTBQ7NpaRS+s_wBtC6K0M1CzQyOUjadA@mail.gmail.com>
Date: Mon, 25 Apr 2022 11:24:27 -0700
From: Nick Desaulniers <ndesaulniers@...gle.com>
To: Masahiro Yamada <masahiroy@...nel.org>
Cc: linux-kbuild@...r.kernel.org, linux-kernel@...r.kernel.org,
Michal Marek <michal.lkml@...kovi.net>
Subject: Re: [PATCH 05/27] modpost: retrieve the module dependency and CRCs in check_exports()
On Sun, Apr 24, 2022 at 12:09 PM Masahiro Yamada <masahiroy@...nel.org> wrote:
>
> Do not repeat the similar code.
>
> It is simpler to do this in check_exports() instead of add_versions().
The 2 loops have been fused into 1. :)
Reviewed-by: Nick Desaulniers <ndesaulniers@...gle.com>
>
> Signed-off-by: Masahiro Yamada <masahiroy@...nel.org>
> ---
>
> scripts/mod/modpost.c | 16 ++++++----------
> 1 file changed, 6 insertions(+), 10 deletions(-)
>
> diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
> index 969a081dba62..f9cbb6b6b7a5 100644
> --- a/scripts/mod/modpost.c
> +++ b/scripts/mod/modpost.c
> @@ -2159,6 +2159,11 @@ static void check_exports(struct module *mod)
> s->name, mod->name);
> continue;
> }
> +
> + s->module = exp->module;
> + s->crc_valid = exp->crc_valid;
> + s->crc = exp->crc;
> +
> basename = strrchr(mod->name, '/');
> if (basename)
> basename++;
> @@ -2251,16 +2256,7 @@ static void add_staging_flag(struct buffer *b, const char *name)
> **/
> static void add_versions(struct buffer *b, struct module *mod)
> {
> - struct symbol *s, *exp;
> -
> - for (s = mod->unres; s; s = s->next) {
> - exp = find_symbol(s->name);
> - if (!exp || exp->module == mod)
> - continue;
> - s->module = exp->module;
> - s->crc_valid = exp->crc_valid;
> - s->crc = exp->crc;
> - }
> + struct symbol *s;
>
> if (!modversions)
> return;
> --
> 2.32.0
>
--
Thanks,
~Nick Desaulniers
Powered by blists - more mailing lists