[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4591a317-9e4f-3608-2e3b-6c213d295bc0@csgroup.eu>
Date: Thu, 10 Feb 2022 11:20:08 +0000
From: Christophe Leroy <christophe.leroy@...roup.eu>
To: Aaron Tomlin <atomlin@...hat.com>,
"mcgrof@...nel.org" <mcgrof@...nel.org>
CC: "cl@...ux.com" <cl@...ux.com>,
"pmladek@...e.com" <pmladek@...e.com>,
"mbenes@...e.cz" <mbenes@...e.cz>,
"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
"jeyu@...nel.org" <jeyu@...nel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-modules@...r.kernel.org" <linux-modules@...r.kernel.org>,
"live-patching@...r.kernel.org" <live-patching@...r.kernel.org>,
"atomlin@...mlin.com" <atomlin@...mlin.com>,
"ghalat@...hat.com" <ghalat@...hat.com>,
"allen.lkml@...il.com" <allen.lkml@...il.com>,
"void@...ifault.com" <void@...ifault.com>,
"joe@...ches.com" <joe@...ches.com>,
"msuchanek@...e.de" <msuchanek@...e.de>,
"oleksandr@...alenko.name" <oleksandr@...alenko.name>
Subject: Re: [PATCH v5 03/13] module: Make internal.h more compliant
Le 09/02/2022 à 18:03, Aaron Tomlin a écrit :
> This patch will address the following warning and style violations
> generated by ./scripts/checkpatch.pl:
>
> WARNING: Use #include <linux/module.h> instead of <asm/module.h>
> #10: FILE: kernel/module/internal.h:10:
> +#include <asm/module.h>
>
> CHECK: spaces preferred around that '-' (ctx:VxV)
> #18: FILE: kernel/module/internal.h:18:
> +#define INIT_OFFSET_MASK (1UL << (BITS_PER_LONG-1))
> ^
> CHECK: extern prototypes should be avoided in .h files
> #84: FILE: kernel/module/internal.h:84:
> +extern int mod_verify_sig(const void *mod, struct load_info *info);
>
> Note: Fortunately, the multiple-include optimisation found in
> include/linux/module.h will prevent duplication/or inclusion more than
> once.
>
> Fixes: f314dfea16a ("modsign: log module name in the event of an error")
> Signed-off-by: Aaron Tomlin <atomlin@...hat.com>
Reviewed-by: Christophe Leroy <christophe.leroy@...roup.eu>
> ---
> kernel/module/internal.h | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/kernel/module/internal.h b/kernel/module/internal.h
> index 1a4b33ce9f5f..1cf5d6dabc97 100644
> --- a/kernel/module/internal.h
> +++ b/kernel/module/internal.h
> @@ -6,7 +6,8 @@
> */
>
> #include <linux/elf.h>
> -#include <asm/module.h>
> +#include <linux/compiler.h>
> +#include <linux/module.h>
> #include <linux/mutex.h>
>
> #ifndef ARCH_SHF_SMALL
> @@ -14,7 +15,7 @@
> #endif
>
> /* If this is set, the section belongs in the init part of the module */
> -#define INIT_OFFSET_MASK (1UL << (BITS_PER_LONG-1))
> +#define INIT_OFFSET_MASK (1UL << (BITS_PER_LONG - 1))
> /* Maximum number of characters written by module_flags() */
> #define MODULE_FLAGS_BUF_SIZE (TAINT_FLAGS_COUNT + 4)
> #define MODULE_SECT_READ_SIZE (3 /* "0x", "\n" */ + (BITS_PER_LONG / 4))
> @@ -55,7 +56,7 @@ struct load_info {
> } index;
> };
>
> -extern int mod_verify_sig(const void *mod, struct load_info *info);
> +int mod_verify_sig(const void *mod, struct load_info *info);
>
> #ifdef CONFIG_MODULE_DECOMPRESS
> int module_decompress(struct load_info *info, const void *buf, size_t size);
Powered by blists - more mailing lists