Skip to content

Commit e649967

Browse files
junjiemao1lijinxia
authored andcommitted
HV: ioapic: clean up remaining integral-related violations
This patch cleans up the remaining integral-related violations in ioapic.c, including * integral narrowing, and * explicit conversion between signed & unsigned integers. Tracked-on: ccm0001001-247033 Signed-off-by: Junjie Mao <junjie.mao@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
1 parent c477138 commit e649967

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

hypervisor/arch/x86/ioapic.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,8 @@ void ioapic_set_rte(uint32_t irq, uint64_t raw_rte)
262262
return;
263263

264264
addr = gsi_table[irq].addr;
265-
rte.lo_32 = raw_rte;
266-
rte.hi_32 = raw_rte >> 32;
265+
rte.lo_32 = (uint32_t)raw_rte;
266+
rte.hi_32 = (uint32_t)(raw_rte >> 32);
267267
ioapic_set_rte_entry(addr, gsi_table[irq].pin, &rte);
268268

269269
dev_dbg(ACRN_DBG_IRQ, "GSI: irq:%d pin:%hhu rte:%x",
@@ -445,7 +445,7 @@ void resume_ioapic(void)
445445

446446
#ifdef HV_DEBUG
447447
void get_rte_info(struct ioapic_rte *rte, bool *mask, bool *irr,
448-
bool *phys, int *delmode, bool *level, int *vector, uint32_t *dest)
448+
bool *phys, uint32_t *delmode, bool *level, uint32_t *vector, uint32_t *dest)
449449
{
450450
*mask = ((rte->lo_32 & IOAPIC_RTE_INTMASK) == IOAPIC_RTE_INTMSET);
451451
*irr = ((rte->lo_32 & IOAPIC_RTE_REM_IRR) == IOAPIC_RTE_REM_IRR);
@@ -472,8 +472,7 @@ int get_ioapic_info(char *str, int str_max_len)
472472
struct ioapic_rte rte;
473473

474474
bool irr, phys, level, mask;
475-
int delmode, vector;
476-
uint32_t dest;
475+
uint32_t delmode, vector, dest;
477476

478477
ioapic_get_rte_entry(addr, pin, &rte);
479478

@@ -485,7 +484,7 @@ int get_ioapic_info(char *str, int str_max_len)
485484
size -= len;
486485
str += len;
487486

488-
len = snprintf(str, size, "0x%02X\t0x%02X\t%s\t%s\t%d\t%d\t%d",
487+
len = snprintf(str, size, "0x%02X\t0x%02X\t%s\t%s\t%u\t%d\t%d",
489488
vector, dest, phys ? "phys" : "logic",
490489
level ? "level" : "edge", delmode >> 8, irr, mask);
491490
size -= len;

0 commit comments

Comments
 (0)