From nobody Thu May 16 16:11:34 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1689953235198734.6213008680961; Fri, 21 Jul 2023 08:27:15 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.567612.886888 (Exim 4.92) (envelope-from ) id 1qMs1a-0003E4-MV; Fri, 21 Jul 2023 15:26:34 +0000 Received: by outflank-mailman (output) from mailman id 567612.886888; Fri, 21 Jul 2023 15:26:34 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qMs1a-0003Dx-Ix; Fri, 21 Jul 2023 15:26:34 +0000 Received: by outflank-mailman (input) for mailman id 567612; Fri, 21 Jul 2023 15:26:33 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qMs1Z-0003Dp-TQ for xen-devel@lists.xenproject.org; Fri, 21 Jul 2023 15:26:33 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id f8619b04-27da-11ee-b23a-6b7b168915f2; Fri, 21 Jul 2023 17:26:32 +0200 (CEST) Received: from nico.bugseng.com (unknown [37.162.18.33]) by support.bugseng.com (Postfix) with ESMTPSA id 7711E4EE0C89; Fri, 21 Jul 2023 17:26:30 +0200 (CEST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: f8619b04-27da-11ee-b23a-6b7b168915f2 From: Nicola Vetrini To: xen-devel@lists.xenproject.org Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com, ayan.kumar.halder@amd.com, consulting@bugseng.com, Nicola Vetrini , Jan Beulich Subject: [XEN PATCH] efi: mechanical renaming to address MISRA C:2012 Rule 5.3 Date: Fri, 21 Jul 2023 17:26:11 +0200 Message-Id: <4da442b03ba783b4db0e56614bed43ce882a32ae.1689953085.git.nicola.vetrini@bugseng.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1689953239226100003 Content-Type: text/plain; charset="utf-8" Rule 5.3 has the following headline: "An identifier declared in an inner scope shall not hide an identifier declared in an outer scope" The function parameters renamed in this patch are hiding a variable defined in an enclosing scope or a function identifier. The following rename is made: - s/cfg/config/ to distinguish from the variable 'cfg', which is hidden by the parameter in= side the modified functions. Signed-off-by: Nicola Vetrini Reviewed-by: Stefano Stabellini --- xen/common/efi/boot.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c index 24169b7b50..233639f3bc 100644 --- a/xen/common/efi/boot.c +++ b/xen/common/efi/boot.c @@ -528,10 +528,10 @@ static char * __init split_string(char *s) return NULL; } =20 -static char *__init get_value(const struct file *cfg, const char *section, +static char *__init get_value(const struct file *config, const char *secti= on, const char *item) { - char *ptr =3D cfg->str, *end =3D ptr + cfg->size; + char *ptr =3D config->str, *end =3D ptr + config->size; size_t slen =3D section ? strlen(section) : 0, ilen =3D strlen(item); bool match =3D !slen; =20 @@ -821,9 +821,9 @@ static bool __init read_section(const EFI_LOADED_IMAGE = *image, return true; } =20 -static void __init pre_parse(const struct file *cfg) +static void __init pre_parse(const struct file *config) { - char *ptr =3D cfg->str, *end =3D ptr + cfg->size; + char *ptr =3D config->str, *end =3D ptr + config->size; bool start =3D true, comment =3D false; =20 for ( ; ptr < end; ++ptr ) @@ -844,7 +844,7 @@ static void __init pre_parse(const struct file *cfg) else start =3D 0; } - if ( cfg->size && end[-1] ) + if ( config->size && end[-1] ) PrintStr(L"No newline at end of config file," " last line will be ignored.\r\n"); } --=20 2.34.1