From patchwork Mon Jun 26 09:52:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Federico Serafini X-Patchwork-Id: 13292583 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 57212EB64D7 for ; Mon, 26 Jun 2023 09:53:04 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.555387.867161 (Exim 4.92) (envelope-from ) id 1qDity-0002Ah-MS; Mon, 26 Jun 2023 09:52:54 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 555387.867161; Mon, 26 Jun 2023 09:52:54 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qDity-0002AW-I8; Mon, 26 Jun 2023 09:52:54 +0000 Received: by outflank-mailman (input) for mailman id 555387; Mon, 26 Jun 2023 09:52:51 +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 1qDitv-0000Ov-J4 for xen-devel@lists.xenproject.org; Mon, 26 Jun 2023 09:52:51 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 36049170-1407-11ee-8611-37d641c3527e; Mon, 26 Jun 2023 11:52:50 +0200 (CEST) Received: from Dell.bugseng.com (unknown [37.163.27.55]) by support.bugseng.com (Postfix) with ESMTPSA id 6EE0D4EE0742; Mon, 26 Jun 2023 11:52:48 +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: 36049170-1407-11ee-8611-37d641c3527e From: Federico Serafini To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Federico Serafini , Stefano Stabellini , Julien Grall , Bertrand Marquis , Volodymyr Babchuk , Michal Orzel , Xenia Ragiadakou , Ayan Kumar Halder Subject: [XEN PATCH v3 6/6] xen/arm: change parameter names in replace_grant_host_mapping(). Date: Mon, 26 Jun 2023 11:52:18 +0200 Message-Id: <2c2b9b3c53e556945baab3dd387bf029e12434b6.1687771796.git.federico.serafini@bugseng.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 In the current version of replace_grant_host_mapping() function, the declaration (correctly) uses the parameter names 'gpaddr' and 'new_gpaddr', while the definition uses the parameter names 'addr' and 'new_addr'. Change the parameter names of the definition to 'gpaddr' and 'new_gpaddr' so that it is clear what type of address is expected and violations of MISRA C:2012 Rule 8.3 are fixed. In both declaration and definition of function replace_grant_host_mapping() change the parameter name 'mfn' to 'frame', thus improving readability and keeping consistency with name used in create_grant_host_mapping(). Signed-off-by: Federico Serafini Reviewed-by: Julien Grall --- xen/arch/arm/include/asm/grant_table.h | 2 +- xen/arch/arm/mm.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/xen/arch/arm/include/asm/grant_table.h b/xen/arch/arm/include/asm/grant_table.h index 265e598e56..f2d115b97d 100644 --- a/xen/arch/arm/include/asm/grant_table.h +++ b/xen/arch/arm/include/asm/grant_table.h @@ -38,7 +38,7 @@ static inline bool gnttab_release_host_mappings(const struct domain *d) int create_grant_host_mapping(unsigned long gpaddr, mfn_t frame, unsigned int flags, unsigned int cache_flags); -int replace_grant_host_mapping(unsigned long gpaddr, mfn_t mfn, +int replace_grant_host_mapping(unsigned long gpaddr, mfn_t frame, unsigned long new_gpaddr, unsigned int flags); /* diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c index 2e9860a754..0a3e1f3b64 100644 --- a/xen/arch/arm/mm.c +++ b/xen/arch/arm/mm.c @@ -1600,17 +1600,17 @@ int create_grant_host_mapping(unsigned long gpaddr, mfn_t frame, return GNTST_okay; } -int replace_grant_host_mapping(unsigned long addr, mfn_t mfn, - unsigned long new_addr, unsigned int flags) +int replace_grant_host_mapping(unsigned long gpaddr, mfn_t frame, + unsigned long new_gpaddr, unsigned int flags) { - gfn_t gfn = gaddr_to_gfn(addr); + gfn_t gfn = gaddr_to_gfn(gpaddr); struct domain *d = current->domain; int rc; - if ( new_addr != 0 || (flags & GNTMAP_contains_pte) ) + if ( new_gpaddr != 0 || (flags & GNTMAP_contains_pte) ) return GNTST_general_error; - rc = guest_physmap_remove_page(d, gfn, mfn, 0); + rc = guest_physmap_remove_page(d, gfn, frame, 0); return rc ? GNTST_general_error : GNTST_okay; }