From patchwork Mon Sep 9 13:36:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alessandro Zucchelli X-Patchwork-Id: 13797058 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D02DBECE57A for ; Mon, 9 Sep 2024 13:36:48 +0000 (UTC) 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 X-Outflank-Mailman: Message body and most headers restored to incoming version 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-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_Pau_Monn=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 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_HANDLE_PARAM(void) arg) { struct xen_foreign_memory_map fmap; struct domain *d; - struct e820entry *e820; + struct e820entry *e; if ( copy_from_guest(&fmap, arg, 1) ) return -EFAULT; @@ -4727,23 +4727,23 @@ long arch_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg) return rc; } - e820 = xmalloc_array(e820entry_t, fmap.map.nr_entries); - if ( e820 == NULL ) + e = xmalloc_array(e820entry_t, fmap.map.nr_entries); + if ( e == NULL ) { rcu_unlock_domain(d); return -ENOMEM; } - 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; } spin_lock(&d->arch.e820_lock); xfree(d->arch.e820); - d->arch.e820 = e820; + d->arch.e820 = e; d->arch.nr_e820 = fmap.map.nr_entries; spin_unlock(&d->arch.e820_lock);