hv:fix return value violation for vioapic_get_rte

Change this API to void type
Add pre-condition, state the input parameters are not NULL.

Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Mingqiang Chi
2018-07-31 17:03:18 +08:00
committed by lijinxia
parent cd3a62f89b
commit ae8836d960
2 changed files with 7 additions and 8 deletions

View File

@@ -629,17 +629,16 @@ int vioapic_mmio_access_handler(struct vcpu *vcpu, struct io_request *io_req,
return ret;
}
bool vioapic_get_rte(struct vm *vm, uint8_t pin, union ioapic_rte *rte)
/**
* @pre vm->arch_vm.virt_ioapic != NULL
* @pre rte != NULL
*/
void vioapic_get_rte(struct vm *vm, uint8_t pin, union ioapic_rte *rte)
{
struct vioapic *vioapic;
vioapic = vm_ioapic(vm);
if ((vioapic != NULL) && (rte != NULL)) {
*rte = vioapic->rtbl[pin];
return true;
} else {
return false;
}
*rte = vioapic->rtbl[pin];
}
#ifdef HV_DEBUG