[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 5 May 2022 21:58:52 +0200
From: Nicolas Schier <nicolas@...sle.eu>
To: Masahiro Yamada <masahiroy@...nel.org>
Cc: linux-kbuild@...r.kernel.org, clang-built-linux@...glegroups.com,
linux-kernel@...r.kernel.org, Ard Biesheuvel <ardb@...nel.org>,
Luis Chamberlain <mcgrof@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
linuxppc-dev@...ts.ozlabs.org, linux-um@...ts.infradead.org,
linux-s390@...r.kernel.org,
Nick Desaulniers <ndesaulniers@...gle.com>,
Sami Tolvanen <samitolvanen@...gle.com>,
Kees Cook <keescook@...omium.org>
Subject: Re: [PATCH v3 03/15] modpost: merge
add_{intree_flag,retpoline,staging_flag} to add_header
On Thu, May 05, 2022 at 04:22:32PM +0900 Masahiro Yamada wrote:
> add_intree_flag(), add_retpoline(), and add_staging_flag() are small
> enough to be merged into add_header().
>
> Signed-off-by: Masahiro Yamada <masahiroy@...nel.org>
> ---
>
> Changes in v3:
> - New patch
>
> scripts/mod/modpost.c | 25 +++++++------------------
> 1 file changed, 7 insertions(+), 18 deletions(-)
>
> diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
> index ebd80c77fa03..ae8e4a4dcfd2 100644
> --- a/scripts/mod/modpost.c
> +++ b/scripts/mod/modpost.c
> @@ -2200,25 +2200,17 @@ static void add_header(struct buffer *b, struct module *mod)
> "#endif\n");
> buf_printf(b, "\t.arch = MODULE_ARCH_INIT,\n");
> buf_printf(b, "};\n");
> -}
>
> -static void add_intree_flag(struct buffer *b, int is_intree)
> -{
> - if (is_intree)
> + if (!external_module)
> buf_printf(b, "\nMODULE_INFO(intree, \"Y\");\n");
> -}
>
> -/* Cannot check for assembler */
> -static void add_retpoline(struct buffer *b)
> -{
> - buf_printf(b, "\n#ifdef CONFIG_RETPOLINE\n");
> - buf_printf(b, "MODULE_INFO(retpoline, \"Y\");\n");
> - buf_printf(b, "#endif\n");
> -}
> + buf_printf(b,
> + "\n"
> + "#ifdef CONFIG_RETPOLINE\n"
> + "MODULE_INFO(retpoline, \"Y\");\n"
> + "#endif\n");
>
> -static void add_staging_flag(struct buffer *b, const char *name)
> -{
> - if (strstarts(name, "drivers/staging"))
> + if (strstarts(mod->name, "drivers/staging"))
> buf_printf(b, "\nMODULE_INFO(staging, \"Y\");\n");
> }
>
> @@ -2544,9 +2536,6 @@ int main(int argc, char **argv)
> check_exports(mod);
>
> add_header(&buf, mod);
> - add_intree_flag(&buf, !external_module);
> - add_retpoline(&buf);
> - add_staging_flag(&buf, mod->name);
> add_versions(&buf, mod);
> add_depends(&buf, mod);
> add_moddevtable(&buf, mod);
> --
> 2.32.0
Reviewed-by: Nicolas Schier <nicolas@...sle.eu>
Powered by blists - more mailing lists