]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
xen/arm: memaccess: Initialize correctly *access in __p2m_get_mem_access
authorJulien Grall <julien.grall@arm.com>
Wed, 27 Mar 2019 18:45:23 +0000 (18:45 +0000)
committerJulien Grall <julien.grall@arm.com>
Tue, 9 Apr 2019 11:40:08 +0000 (12:40 +0100)
The commit 8d84e701fd "xen/arm: initialize access" initializes
*access using the wrong enumeration type. This result to a warning
using clang:

mem_access.c:50:20: error: implicit conversion from enumeration type
'p2m_access_t' to different enumeration type 'xenmem_access_t'
[-Werror,-Wenum-conversion]
    *access = p2m->default_access;
            ~ ~~~~~^~~~~~~~~~~~~~

The correct solution is to use the array memaccess that will do the
conversion between the 2 enums.

Fixes: 8d84e701fd ("xen/arm: initialize access")
Signed-off-by: Julien Grall <julien.grall@arm.com>
Acked-by: Razvan Cojocaru <rcojocaru@bitdefender.com>
xen/arch/arm/mem_access.c

index db49372a2ce5c2ffb53ec9214e31870058ad6836..3e3620294cbcee685f13c25a03f343f7d4422847 100644 (file)
@@ -47,7 +47,7 @@ static int __p2m_get_mem_access(struct domain *d, gfn_t gfn,
     };
 
     ASSERT(p2m_is_locked(p2m));
-    *access = p2m->default_access;
+    *access = memaccess[p2m->default_access];
 
     /* If no setting was ever set, just return rwx. */
     if ( !p2m->mem_access_enabled )