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

[xen master] xen/arm: gnttab: use static inlines for gnttab_{release_}host_mapping*



commit 207abdb38ee987e99385263e3e56b6c500d74cbc
Author:     Michal Orzel <michal.orzel@xxxxxxx>
AuthorDate: Fri May 6 11:42:24 2022 +0200
Commit:     Julien Grall <jgrall@xxxxxxxxxx>
CommitDate: Thu May 12 18:33:27 2022 +0100

    xen/arm: gnttab: use static inlines for gnttab_{release_}host_mapping*
    
    Function unmap_common_complete (common/grant_table.c) defines and sets
    a variable ld that is later on passed to a macro:
    gnttab_host_mapping_get_page_type().
    On Arm this macro does not make use of any arguments causing a compiler
    to warn about unused-but-set variable (when -Wunused-but-set-variable
    is enabled). Fix it by converting this macro to a static inline
    helper and using the boolean return type.
    
    While there, also convert macro gnttab_release_host_mappings.
    
    Signed-off-by: Michal Orzel <michal.orzel@xxxxxxx>
    Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
    Acked-by: Julien Grall <jgrall@xxxxxxxxxx>
---
 xen/arch/arm/include/asm/grant_table.h | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/xen/arch/arm/include/asm/grant_table.h 
b/xen/arch/arm/include/asm/grant_table.h
index d31a4d6805..a283dd5cd6 100644
--- a/xen/arch/arm/include/asm/grant_table.h
+++ b/xen/arch/arm/include/asm/grant_table.h
@@ -29,12 +29,22 @@ static inline void gnttab_mark_dirty(struct domain *d, 
mfn_t mfn)
 #endif
 }
 
+static inline bool gnttab_host_mapping_get_page_type(bool ro,
+                                                     const struct domain *ld,
+                                                     const struct domain *rd)
+{
+    return false;
+}
+
+static inline bool gnttab_release_host_mappings(const struct domain *d)
+{
+    return true;
+}
+
 int create_grant_host_mapping(unsigned long gpaddr, mfn_t mfn,
                               unsigned int flags, unsigned int cache_flags);
-#define gnttab_host_mapping_get_page_type(ro, ld, rd) (0)
 int replace_grant_host_mapping(unsigned long gpaddr, mfn_t mfn,
                                unsigned long new_gpaddr, unsigned int flags);
-#define gnttab_release_host_mappings(domain) 1
 
 /*
  * The region used by Xen on the memory will never be mapped in DOM0
--
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®.