summaryrefslogtreecommitdiffstats
path: root/kernel/module.c
diff options
context:
space:
mode:
authorSergey Shtylyov <s.shtylyov@omprussia.ru>2020-10-31 23:06:45 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-04-07 14:47:38 +0200
commitd9b98ccdfed02c2b0a88be952c32c9b1dd41f6f6 (patch)
treef117346a7716bc7a4efb12a122d3e3943e0d802a /kernel/module.c
parent1a8c5fbe2f1dab0787165711e8fd7322112f8b71 (diff)
downloadlinux-stable-d9b98ccdfed02c2b0a88be952c32c9b1dd41f6f6.tar.gz
linux-stable-d9b98ccdfed02c2b0a88be952c32c9b1dd41f6f6.tar.bz2
linux-stable-d9b98ccdfed02c2b0a88be952c32c9b1dd41f6f6.zip
module: merge repetitive strings in module_sig_check()
[ Upstream commit 705e9195187d85249fbb0eaa844b1604a98fbc9a ] The 'reason' variable in module_sig_check() points to 3 strings across the *switch* statement, all needlessly starting with the same text. Let's put the starting text into the pr_notice() call -- it saves 21 bytes of the object code (x86 gcc 10.2.1). Suggested-by: Joe Perches <joe@perches.com> Reviewed-by: Miroslav Benes <mbenes@suse.cz> Signed-off-by: Sergey Shtylyov <s.shtylyov@omprussia.ru> Signed-off-by: Jessica Yu <jeyu@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'kernel/module.c')
-rw-r--r--kernel/module.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/kernel/module.c b/kernel/module.c
index 0338fdd6acd8..9fe3e9b85348 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -2908,16 +2908,17 @@ static int module_sig_check(struct load_info *info, int flags)
* enforcing, certain errors are non-fatal.
*/
case -ENODATA:
- reason = "Loading of unsigned module";
+ reason = "unsigned module";
goto decide;
case -ENOPKG:
- reason = "Loading of module with unsupported crypto";
+ reason = "module with unsupported crypto";
goto decide;
case -ENOKEY:
- reason = "Loading of module with unavailable key";
+ reason = "module with unavailable key";
decide:
if (is_module_sig_enforced()) {
- pr_notice("%s: %s is rejected\n", info->name, reason);
+ pr_notice("%s: loading of %s is rejected\n",
+ info->name, reason);
return -EKEYREJECTED;
}