Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3517828pxf; Mon, 5 Apr 2021 14:27:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzkGimTs6ov9zrFbIJb8Xb974sttDAeYPzziVq77pSS0xtx1y8fiqZkDpK88cpcqgONb8aE X-Received: by 2002:a6b:d110:: with SMTP id l16mr21719811iob.167.1617658058519; Mon, 05 Apr 2021 14:27:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617658058; cv=none; d=google.com; s=arc-20160816; b=cTdJghuoPP+nUQSjkGc5yTDSdrj+edLLTIOC9WvyLGpa/g6suBY4ZgfAOv3eWe/AEd M0UplSHCGaG5x5zOyP9T4t8tAA3KTpA6Wy/KHRe0yx4nUsOkog1XuDjKZDr1pjBCA1zl k+9187dfaNwttgDkmHCXoRe5IpZsDCQoUv05F4DiOUtu4OnZ8K5mOJ1urkU95kTEtDvh M7Tz1B68i3yv2dSY3SQ8LRaed/zTSeesG/P/KUo0RQBUOjhiKRAf4tuIO/GkVUtsFj/o 3cHUWjEBctBu/wDtrADs2rv+fIfvfENPZtqYq7ThLhoagLPVWLtJ8MQAQW82mzDRbKKx U4Aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:cc:to:subject:dkim-filter; bh=nZ9c4iZMyuzpXVC2kZqLL6UAe9s19j7QmqYHjcL+31g=; b=Hbvxrb9f9irAB5N79a5xUy527z85rCEePZt52PCMcPikElz7WwhkiuFfPJC42XljCm KhD0kvvv46BwhuqTaqbgfS9jsHFxoVAAdOg/xGHqZrpD9mPDpdSZf6l/KHzObUh6NfRO vldmMFYezy1C0Qx+KYi801PQb/EnNywD9oFOiEJHlMqBsXjPgJ0Wkvh1G4QRn+D/ggdG 9RLhFond+3+QYuX1A/pIthS5lxi5qDmW2/FELCzekakam7zcyFZZsmXoZfvOTzx20ZkI rsatCEWSKcT04Oigj9hfeG0rrMzlArctub4RxrPACcYSxHd3vzmf6Vfw8T2zTzzOXkBr W+fA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=omprussia.ru Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z3si17225596jan.94.2021.04.05.14.27.13; Mon, 05 Apr 2021 14:27:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=omprussia.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241129AbhDENfu (ORCPT + 99 others); Mon, 5 Apr 2021 09:35:50 -0400 Received: from mxout01.lancloud.ru ([45.84.86.81]:52348 "EHLO mxout01.lancloud.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232694AbhDENft (ORCPT ); Mon, 5 Apr 2021 09:35:49 -0400 Received: from LanCloud DKIM-Filter: OpenDKIM Filter v2.11.0 mxout01.lancloud.ru 8967D20E3CC1 Received: from LanCloud Received: from LanCloud Received: from LanCloud Subject: Re: [PATCH 5.4 03/74] module: merge repetitive strings in module_sig_check() To: Greg Kroah-Hartman , CC: , Joe Perches , Miroslav Benes , Jessica Yu , Sasha Levin References: <20210405085024.703004126@linuxfoundation.org> <20210405085024.812932452@linuxfoundation.org> From: Sergey Shtylyov Organization: Open Mobile Platform, LLC Message-ID: <35560933-d158-76ee-0034-0b5f43d9a3c2@omprussia.ru> Date: Mon, 5 Apr 2021 16:35:40 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210405085024.812932452@linuxfoundation.org> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [192.168.11.198] X-ClientProxiedBy: LFEXT02.lancloud.ru (fd00:f066::142) To LFEX1908.lancloud.ru (fd00:f066::208) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/5/21 11:53 AM, Greg Kroah-Hartman wrote: > From: Sergey Shtylyov > > [ 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 > Reviewed-by: Miroslav Benes > Signed-off-by: Sergey Shtylyov > Signed-off-by: Jessica Yu > Signed-off-by: Sasha Levin > --- > kernel/module.c | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) > > diff --git a/kernel/module.c b/kernel/module.c > index ab1f97cfe18d..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 is rejected\n", reason); > + pr_notice("%s: loading of %s is rejected\n", > + info->name, reason); Mhm, in 5.4 there was no printing of 'info->name'... [...] MBR, Sergey