From nobody Fri Nov 22 14:07:23 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 1718381617284852.7149609944266; Fri, 14 Jun 2024 09:13:37 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.740801.1147899 (Exim 4.92) (envelope-from ) id 1sI9YE-0005ka-Gp; Fri, 14 Jun 2024 16:13:18 +0000 Received: by outflank-mailman (output) from mailman id 740801.1147899; Fri, 14 Jun 2024 16:13:18 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sI9YE-0005kT-Da; Fri, 14 Jun 2024 16:13:18 +0000 Received: by outflank-mailman (input) for mailman id 740801; Fri, 14 Jun 2024 16:13:17 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sI9YD-0005jz-6e for xen-devel@lists.xenproject.org; Fri, 14 Jun 2024 16:13:17 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 013e1e08-2a69-11ef-b4bb-af5377834399; Fri, 14 Jun 2024 18:13:15 +0200 (CEST) Received: from delta.bugseng.com.homenet.telecomitalia.it (host-79-46-197-197.retail.telecomitalia.it [79.46.197.197]) by support.bugseng.com (Postfix) with ESMTPSA id 369AF4EE0757; Fri, 14 Jun 2024 18:13:13 +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: 013e1e08-2a69-11ef-b4bb-af5377834399 From: Alessandro Zucchelli To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Alessandro Zucchelli , Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Subject: [PATCH 1/2] x86/mm address violations of MISRA C:2012 Rule 5.3 Date: Fri, 14 Jun 2024 18:12:25 +0200 Message-Id: <80cb7054b82f55f11159faf5f10bfacf44758be0.1718380780.git.alessandro.zucchelli@bugseng.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1718381619048100002 Content-Type: text/plain; charset="utf-8" This addresses violations of MISRA C:2012 Rule 5.3 which states as following: An identifier declared in an inner scope shall not hide an identifier declared in an outer scope. No functional change. Signed-off-by: Alessandro Zucchelli --- xen/arch/x86/mm.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c index 5471b6b1f2..720d56e103 100644 --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -4703,7 +4703,7 @@ long arch_memory_op(unsigned long cmd, XEN_GUEST_HAND= LE_PARAM(void) arg) { struct xen_foreign_memory_map fmap; struct domain *d; - struct e820entry *map; + struct e820entry *e; =20 if ( copy_from_guest(&fmap, arg, 1) ) return -EFAULT; @@ -4722,23 +4722,23 @@ long arch_memory_op(unsigned long cmd, XEN_GUEST_HA= NDLE_PARAM(void) arg) return rc; } =20 - map =3D xmalloc_array(e820entry_t, fmap.map.nr_entries); - if ( map =3D=3D NULL ) + e =3D xmalloc_array(e820entry_t, fmap.map.nr_entries); + if ( e =3D=3D NULL ) { rcu_unlock_domain(d); return -ENOMEM; } =20 - if ( copy_from_guest(map, fmap.map.buffer, fmap.map.nr_entries) ) + if ( copy_from_guest(e, fmap.map.buffer, fmap.map.nr_entries) ) { - xfree(map); + xfree(e); rcu_unlock_domain(d); return -EFAULT; } =20 spin_lock(&d->arch.e820_lock); xfree(d->arch.e820); - d->arch.e820 =3D map; + d->arch.e820 =3D e; d->arch.nr_e820 =3D fmap.map.nr_entries; spin_unlock(&d->arch.e820_lock); =20 --=20 2.34.1