mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-24 02:08:04 +00:00
HV: treewide: fix violations of coding guideline C-EP-05
The coding guideline rule C-EP-05 requires that 'parentheses shall be used to set the operator precedence explicitly'. This patch adds the missing parentheses detected by the static analyzer. Tracked-On: #6776 Signed-off-by: Junjie Mao <junjie.mao@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -99,14 +99,14 @@ vioapic_set_pinstate(struct acrn_single_vioapic *vioapic, uint32_t pin, uint32_t
|
||||
/* clear pin_state and deliver interrupt according to polarity */
|
||||
bitmap_clear_nolock((uint16_t)(pin & 0x3FU), &vioapic->pin_state[pin >> 6U]);
|
||||
if ((rte.bits.intr_polarity == IOAPIC_RTE_INTPOL_ALO)
|
||||
&& old_lvl != level) {
|
||||
&& (old_lvl != level)) {
|
||||
vioapic_generate_intr(vioapic, pin);
|
||||
}
|
||||
} else {
|
||||
/* set pin_state and deliver intrrupt according to polarity */
|
||||
bitmap_set_nolock((uint16_t)(pin & 0x3FU), &vioapic->pin_state[pin >> 6U]);
|
||||
if ((rte.bits.intr_polarity == IOAPIC_RTE_INTPOL_AHI)
|
||||
&& old_lvl != level) {
|
||||
&& (old_lvl != level)) {
|
||||
vioapic_generate_intr(vioapic, pin);
|
||||
}
|
||||
}
|
||||
@@ -277,8 +277,8 @@ static inline bool vioapic_need_intr(const struct acrn_single_vioapic *vioapic,
|
||||
if (pin < vioapic->chipinfo.nr_pins) {
|
||||
rte = vioapic->rtbl[pin];
|
||||
lvl = (uint32_t)bitmap_test(pin & 0x3FU, &vioapic->pin_state[pin >> 6U]);
|
||||
ret = !!(((rte.bits.intr_polarity == IOAPIC_RTE_INTPOL_ALO) && lvl == 0U) ||
|
||||
((rte.bits.intr_polarity == IOAPIC_RTE_INTPOL_AHI) && lvl != 0U));
|
||||
ret = !!(((rte.bits.intr_polarity == IOAPIC_RTE_INTPOL_ALO) && (lvl == 0U)) ||
|
||||
((rte.bits.intr_polarity == IOAPIC_RTE_INTPOL_AHI) && (lvl != 0U)));
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
@@ -462,7 +462,7 @@ static int32_t vpic_ocw2(const struct acrn_vpic *vpic, struct i8259_reg_state *i
|
||||
|
||||
/* if level ack PTDEV */
|
||||
if ((i8259->elc & (1U << (isr_bit & 0x7U))) != 0U) {
|
||||
vgsi = vpin_to_vgsi(vm, (primary_pic(vpic, i8259) ? isr_bit : isr_bit + 8U));
|
||||
vgsi = vpin_to_vgsi(vm, (primary_pic(vpic, i8259) ? isr_bit : (isr_bit + 8U)));
|
||||
ptirq_intx_ack(vm, vgsi, INTX_CTLR_PIC);
|
||||
}
|
||||
} else if (((val & OCW2_SL) != 0U) && i8259->rotate) {
|
||||
|
Reference in New Issue
Block a user