Skip to content

Commit 8587715

Browse files
Sergey Shtylyovgregkh
authored andcommitted
module: merge repetitive strings in module_sig_check()
[ Upstream commit 705e919 ] 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>
1 parent c02a33f commit 8587715

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

‎kernel/module.c‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2922,16 +2922,17 @@ static int module_sig_check(struct load_info *info, int flags)
29222922
* enforcing, certain errors are non-fatal.
29232923
*/
29242924
case -ENODATA:
2925-
reason = "Loading of unsigned module";
2925+
reason = "unsigned module";
29262926
goto decide;
29272927
case -ENOPKG:
2928-
reason = "Loading of module with unsupported crypto";
2928+
reason = "module with unsupported crypto";
29292929
goto decide;
29302930
case -ENOKEY:
2931-
reason = "Loading of module with unavailable key";
2931+
reason = "module with unavailable key";
29322932
decide:
29332933
if (is_module_sig_enforced()) {
2934-
pr_notice("%s: %s is rejected\n", info->name, reason);
2934+
pr_notice("%s: loading of %s is rejected\n",
2935+
info->name, reason);
29352936
return -EKEYREJECTED;
29362937
}
29372938

0 commit comments

Comments
 (0)