From nobody Tue May 21 01:41:55 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 1690209286852972.8672017976396; Mon, 24 Jul 2023 07:34:46 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.569000.889283 (Exim 4.92) (envelope-from ) id 1qNwdi-0002qc-8v; Mon, 24 Jul 2023 14:34:22 +0000 Received: by outflank-mailman (output) from mailman id 569000.889283; Mon, 24 Jul 2023 14:34:22 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qNwdi-0002qV-4w; Mon, 24 Jul 2023 14:34:22 +0000 Received: by outflank-mailman (input) for mailman id 569000; Mon, 24 Jul 2023 14:34:21 +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 1qNwdh-0002qP-N7 for xen-devel@lists.xenproject.org; Mon, 24 Jul 2023 14:34:21 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 2cf2311f-2a2f-11ee-b23b-6b7b168915f2; Mon, 24 Jul 2023 16:34:20 +0200 (CEST) Received: from nico.bugseng.com (unknown [37.162.132.135]) by support.bugseng.com (Postfix) with ESMTPSA id E11814EE073E; Mon, 24 Jul 2023 16:34:18 +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: 2cf2311f-2a2f-11ee-b23b-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 v2] efi: mechanical renaming to address MISRA C:2012 Rule 5.3 Date: Mon, 24 Jul 2023 16:26:07 +0200 Message-Id: <60e2908f5a6c8aec082b59b44a688c260805c7b2.1690208527.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: 1690209288548100001 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. The following rename is made: - s/cfg/file/ to distinguish from the variable 'cfg', which is hidden by the parameter in= side the modified functions. Signed-off-by: Nicola Vetrini Acked-by: Jan Beulich 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..79a654af69 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 *file, const char *section, const char *item) { - char *ptr =3D cfg->str, *end =3D ptr + cfg->size; + char *ptr =3D file->str, *end =3D ptr + file->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 *file) { - char *ptr =3D cfg->str, *end =3D ptr + cfg->size; + char *ptr =3D file->str, *end =3D ptr + file->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 ( file->size && end[-1] ) PrintStr(L"No newline at end of config file," " last line will be ignored.\r\n"); } --=20 2.34.1