hv: fix integer violations

The operands to shift operations (<<, >>) shall be unsigned integers.

v1 -> v2:
 * replace 12U with CPU_PAGE_SHIFT when it is address shift case.
 * replace 6UL with 0x6UL

Tracked-On: #861
Signed-off-by: Shiqing Gao <shiqing.gao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Shiqing Gao
2018-10-31 10:43:12 +08:00
committed by lijinxia
parent 4d01e60eda
commit 60d0a75243
12 changed files with 54 additions and 54 deletions

View File

@@ -417,7 +417,7 @@ static void vpic_set_pinstate(struct acrn_vpic *vpic, uint8_t pin,
i8259->pin_state[pin & 0x7U] = 0U;
}
lvl_trigger = ((vpic->i8259[pin >> 3U].elc & (1U << (pin & 0x7U))) != 0);
lvl_trigger = ((vpic->i8259[pin >> 3U].elc & (1U << (pin & 0x7U))) != 0U);
if (((old_lvl == 0U) && (level == 1U)) ||
((level == 1U) && (lvl_trigger == true))) {
@@ -552,7 +552,7 @@ static void vpic_pin_accepted(struct i8259_reg_state *i8259, uint8_t pin)
{
i8259->intr_raised = false;
if ((i8259->elc & (1U << pin)) == 0) {
if ((i8259->elc & (1U << pin)) == 0U) {
/*only used edge trigger mode*/
i8259->request &= ~(uint8_t)(1U << pin);
}