mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-01-04 23:24:56 +00:00
hv: fix 'Function return value potentially unused'
MISRA-C requires that if the return value of a function call is assigned to a local variable, this value shall be used in all paths. This patch moves the variable assignment right before the moment that the variable is used. 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:
@@ -116,16 +116,14 @@ static void ptdev_build_physical_msi(struct acrn_vm *vm, struct ptdev_msi_info *
|
||||
}
|
||||
|
||||
static union ioapic_rte
|
||||
ptdev_build_physical_rte(struct acrn_vm *vm,
|
||||
struct ptdev_remapping_info *entry)
|
||||
ptdev_build_physical_rte(struct acrn_vm *vm, struct ptdev_remapping_info *entry)
|
||||
{
|
||||
union ioapic_rte rte;
|
||||
uint32_t phys_irq = entry->allocated_pirq;
|
||||
uint32_t vector = irq_to_vector(phys_irq);
|
||||
union source_id *virt_sid = &entry->virt_sid;
|
||||
|
||||
if (virt_sid->intx_id.src == PTDEV_VPIN_IOAPIC) {
|
||||
uint64_t vdmask, pdmask, delmode, dest_mask;
|
||||
uint64_t vdmask, pdmask, delmode, dest_mask, vector;
|
||||
uint32_t dest;
|
||||
union ioapic_rte virt_rte;
|
||||
bool phys;
|
||||
@@ -164,9 +162,9 @@ ptdev_build_physical_rte(struct acrn_vm *vm,
|
||||
}
|
||||
|
||||
/* update physical delivery mode, dest mode(logical) & vector */
|
||||
rte.full &= ~(IOAPIC_RTE_DESTMOD |
|
||||
IOAPIC_RTE_DELMOD | IOAPIC_RTE_INTVEC);
|
||||
rte.full |= IOAPIC_RTE_DESTLOG | delmode | (uint64_t)vector;
|
||||
vector = (uint64_t)irq_to_vector(phys_irq);
|
||||
rte.full &= ~(IOAPIC_RTE_DESTMOD | IOAPIC_RTE_DELMOD | IOAPIC_RTE_INTVEC);
|
||||
rte.full |= IOAPIC_RTE_DESTLOG | delmode | vector;
|
||||
|
||||
dest_mask = calculate_logical_dest_mask(pdmask);
|
||||
/* update physical dest field */
|
||||
|
||||
Reference in New Issue
Block a user