[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen master] xen/arm: change parameter names in replace_grant_host_mapping().



commit 5b9c96a808efdc004a876c03c2ea0bd0c5358812
Author:     Federico Serafini <federico.serafini@xxxxxxxxxxx>
AuthorDate: Mon Jun 26 11:52:18 2023 +0200
Commit:     Stefano Stabellini <stefano.stabellini@xxxxxxx>
CommitDate: Wed Jun 28 15:54:21 2023 -0700

    xen/arm: change parameter names in replace_grant_host_mapping().
    
    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 <federico.serafini@xxxxxxxxxxx>
    Reviewed-by: Julien Grall <jgrall@xxxxxxxxxx>
---
 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;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.