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:
Tim Deegan committed 2012-04-11 13:10:33 +01:00
1 parent 347c906bff
commit b656ffb608
1 file changed
+2 -2
+2 -2
View File
@@ -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];
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.