From nobody Wed Dec 4 08:36:03 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; dkim=pass; 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; dmarc=pass(p=none dis=none) header.from=bugseng.com ARC-Seal: i=1; a=rsa-sha256; t=1725889027; cv=none; d=zohomail.com; s=zohoarc; b=fCGDbdnqSZBmsZam5u/fn7cEh5+nbw3TukH5JQ2IYpUu63/QSECsNGLp4HrDhJyz2qvOm5WyovqjlohIeKbzp6pVjZrbTaz0RK1GBFsHTaZVAUXPwsAEYyEcfKAcCY96gBDht8nGNVhi+wxzv3d844NAy8orNDJ9lS88J0eDhlU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1725889027; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=5sm6zx6Olz9lNdMKXEEK2BJzV0HymiL4BL6/ZZ+vkQA=; b=GzCSjGeZz2krazsfSKRmmcE/hTeVk22or2ggTiO1XqBvf8E9Tdv63QFQuwc66h7g0RSdPQFZQK+rdRsjbaiZiu+DSsL3BWX4b0uj+h7ceXNGb+Vo1cBhm4LmCpcZ2QrBH4s7SsbEpIlVaSvoOwJDreoCJ65IlGzsnhTaMfnZ4fo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1725889027086302.0878973059058; Mon, 9 Sep 2024 06:37:07 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.794513.1203469 (Exim 4.92) (envelope-from ) id 1sneZD-0008H9-4O; Mon, 09 Sep 2024 13:36:31 +0000 Received: by outflank-mailman (output) from mailman id 794513.1203469; Mon, 09 Sep 2024 13:36:31 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sneZD-0008H2-0G; Mon, 09 Sep 2024 13:36:31 +0000 Received: by outflank-mailman (input) for mailman id 794513; Mon, 09 Sep 2024 13:36:29 +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 1sneZB-0008Fa-4K for xen-devel@lists.xenproject.org; Mon, 09 Sep 2024 13:36:29 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 830f0807-6eb0-11ef-99a1-01e77a169b0f; Mon, 09 Sep 2024 15:36:26 +0200 (CEST) Received: from delta.home-life.hub (unknown [176.206.49.208]) by support.bugseng.com (Postfix) with ESMTPSA id 46F654EE0776; Mon, 9 Sep 2024 15:36:25 +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: 830f0807-6eb0-11ef-99a1-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=bugseng.com; s=mail; t=1725888985; bh=dPZAAGZbBtIpnQAvYJuhw1T8HhmIhQKlthbwTS8NlPQ=; h=From:To:Cc:Subject:Date:From; b=H7CzGSRH9dAAbi9LqOi/4ja+Z/UMj8p0xKlyciJBwuh5qGym8VJIMAGY7Ty9Ou3MO MrSsuYLeiZq0WPXizs0Idxgl7awi7mjhP58oDUmdAYo+5X+1fe1/Nh2N+AQu6UhVxU +ZMbBxCKz4t/mjXbEcNxQjn4qOGtigj1Isx3xy+oZDskXvKxUW1Rb+Xybu69e+RdA6 BiZiKv//soO/JQZizU1vxUqQvHqDYN+R439qAe+Vc808lGImqoK4eLRSghg17CSWnT QWFlCBlxfSlwstmtkTIH72+fOv1kJ2WlG0fIO9AtoKiSSMYIMXrNrMvtLrgbu4njxV qbBUugHwIK9LA== 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: [XEN PATCH v2] x86/mm address violations of MISRA C:2012 Rule 5.3 Date: Mon, 9 Sep 2024 15:36:13 +0200 Message-Id: <201625791b87a4ab20e6fb38642ed64f88ce8b2d.1725888742.git.alessandro.zucchelli@bugseng.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @bugseng.com) X-ZM-MESSAGEID: 1725889028184116600 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. In /x86/mm.c the object struct e820entry *e820 hides an identifier with the same name declared in x86/include/asm/e820.h. No functional change. Signed-off-by: Alessandro Zucchelli Acked-by: Jan Beulich --- Changes in v2: - rebased against current staging tree 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 c735aaf0e8..d537a799bc 100644 --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -4708,7 +4708,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 *e820; + struct e820entry *e; =20 if ( copy_from_guest(&fmap, arg, 1) ) return -EFAULT; @@ -4727,23 +4727,23 @@ long arch_memory_op(unsigned long cmd, XEN_GUEST_HA= NDLE_PARAM(void) arg) return rc; } =20 - e820 =3D xmalloc_array(e820entry_t, fmap.map.nr_entries); - if ( e820 =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(e820, fmap.map.buffer, fmap.map.nr_entries) ) + if ( copy_from_guest(e, fmap.map.buffer, fmap.map.nr_entries) ) { - xfree(e820); + xfree(e); rcu_unlock_domain(d); return -EFAULT; } =20 spin_lock(&d->arch.e820_lock); xfree(d->arch.e820); - d->arch.e820 =3D e820; + 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