From: Sergey Shtylyov Date: Sat, 31 Oct 2020 20:06:45 +0000 (+0300) Subject: module: merge repetitive strings in module_sig_check() X-Git-Tag: accepted/tizen/unified/20230118.172025~8230^2~13 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=705e9195187d85249fbb0eaa844b1604a98fbc9a;p=platform%2Fkernel%2Flinux-rpi.git 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 Reviewed-by: Miroslav Benes Signed-off-by: Sergey Shtylyov Signed-off-by: Jessica Yu --- diff --git a/kernel/module.c b/kernel/module.c index b342350..0e54d58 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -2907,16 +2907,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; }