module: merge repetitive strings in module_sig_check()

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>
This commit is contained in:
Sergey Shtylyov 2020-10-31 23:06:45 +03:00 committed by Jessica Yu
parent 5e8ed280da
commit 705e919518

View file

@ -2907,16 +2907,17 @@ static int module_sig_check(struct load_info *info, int flags)
* enforcing, certain errors are non-fatal. * enforcing, certain errors are non-fatal.
*/ */
case -ENODATA: case -ENODATA:
reason = "Loading of unsigned module"; reason = "unsigned module";
goto decide; goto decide;
case -ENOPKG: case -ENOPKG:
reason = "Loading of module with unsupported crypto"; reason = "module with unsupported crypto";
goto decide; goto decide;
case -ENOKEY: case -ENOKEY:
reason = "Loading of module with unavailable key"; reason = "module with unavailable key";
decide: decide:
if (is_module_sig_enforced()) { 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; return -EKEYREJECTED;
} }