From c5c338aecce9aef5135d1cfba48335e1302cce47 Mon Sep 17 00:00:00 2001 From: Huihuang Shi Date: Thu, 21 Jun 2018 17:52:07 +0800 Subject: [PATCH] vtd:fix "negative shift" MISRA C doesn't allowed negative shift, changed any potential signed value to unsigned value. Signed-off-by: Huihuang Shi Acked-by: Eddie Dong --- hypervisor/arch/x86/vtd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hypervisor/arch/x86/vtd.c b/hypervisor/arch/x86/vtd.c index f436d8c13..5be872d1c 100644 --- a/hypervisor/arch/x86/vtd.c +++ b/hypervisor/arch/x86/vtd.c @@ -472,9 +472,9 @@ static struct dmar_drhd_rt *device_to_dmaru(uint16_t segment, uint8_t bus, return NULL; } -static int alloc_domain_id(void) +static uint8_t alloc_domain_id(void) { - int i; + uint8_t i; uint64_t mask; spinlock_obtain(&domain_lock); @@ -492,7 +492,7 @@ static int alloc_domain_id(void) return i; } -static void free_domain_id(int dom_id) +static void free_domain_id(uint16_t dom_id) { uint64_t mask = (1 << dom_id);