Skip to content

Commit c5c338a

Browse files
Shawnshhlijinxia
authored andcommitted
vtd:fix "negative shift"
MISRA C doesn't allowed negative shift, changed any potential signed value to unsigned value. Signed-off-by: Huihuang Shi <huihuang.shi@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
1 parent 218a0a8 commit c5c338a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

hypervisor/arch/x86/vtd.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -472,9 +472,9 @@ static struct dmar_drhd_rt *device_to_dmaru(uint16_t segment, uint8_t bus,
472472
return NULL;
473473
}
474474

475-
static int alloc_domain_id(void)
475+
static uint8_t alloc_domain_id(void)
476476
{
477-
int i;
477+
uint8_t i;
478478
uint64_t mask;
479479

480480
spinlock_obtain(&domain_lock);
@@ -492,7 +492,7 @@ static int alloc_domain_id(void)
492492
return i;
493493
}
494494

495-
static void free_domain_id(int dom_id)
495+
static void free_domain_id(uint16_t dom_id)
496496
{
497497
uint64_t mask = (1 << dom_id);
498498

0 commit comments

Comments
 (0)