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>
p2m->default_access,
};
- if ( access >= HVMMEM_access_default || access < 0 )
+ if ( (unsigned) access >= HVMMEM_access_default )
return -EINVAL;
a = memaccess[access];
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];