mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
x86/mm: Another couple of comparisons of unsigned vars with < 0.
Adding the explicit (unsigned) casts in case enums ever end up signed. Signed-off-by: Tim Deegan <tim@xen.org> Acked-by: Keir Fraser <keir@xen.org> Committed-by: Tim Deegan <tim@xen.org>
This commit is contained in:
1 parent
347c906bff
commit
b656ffb608
1 file changed
+2
-2
@@ -1305,7 +1305,7 @@ int p2m_set_mem_access(struct domain *d, unsigned long start_pfn,
|
||||
p2m->default_access,
|
||||
};
|
||||
|
||||
if ( access >= HVMMEM_access_default || access < 0 )
|
||||
if ( (unsigned) access >= HVMMEM_access_default )
|
||||
return -EINVAL;
|
||||
|
||||
a = memaccess[access];
|
||||
@@ -1367,7 +1367,7 @@ int p2m_get_mem_access(struct domain *d, unsigned long pfn,
|
||||
if ( mfn_x(mfn) == INVALID_MFN )
|
||||
return -ESRCH;
|
||||
|
||||
if ( a >= ARRAY_SIZE(memaccess) || a < 0 )
|
||||
if ( (unsigned) a >= ARRAY_SIZE(memaccess) )
|
||||
return -ERANGE;
|
||||
|
||||
*access = memaccess[a];
|
||||
|
||||