mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-06-07 17:46:15 +00:00
dm: refine assert usage
Remove unnecessary assert and add error handling when required. Tracked-On: #3252 Signed-off-by: Jian Jun Chen <jian.jun.chen@intel.com> Reviewed-by: Shuo A Liu <shuo.a.liu@intel.com>
This commit is contained in:
committed by
ACRN System Integration
parent
0a8bf6cee4
commit
56469f3edc
@@ -60,22 +60,18 @@ static void
|
||||
pci_uart_write(struct vmctx *ctx, int vcpu, struct pci_vdev *dev,
|
||||
int baridx, uint64_t offset, int size, uint64_t value)
|
||||
{
|
||||
assert(baridx == 0);
|
||||
assert(size == 1);
|
||||
|
||||
uart_write(dev->arg, offset, value);
|
||||
if (baridx == 0 && size == 1)
|
||||
uart_write(dev->arg, offset, value);
|
||||
}
|
||||
|
||||
uint64_t
|
||||
pci_uart_read(struct vmctx *ctx, int vcpu, struct pci_vdev *dev,
|
||||
int baridx, uint64_t offset, int size)
|
||||
{
|
||||
uint8_t val;
|
||||
uint8_t val = 0xff;
|
||||
|
||||
assert(baridx == 0);
|
||||
assert(size == 1);
|
||||
|
||||
val = uart_read(dev->arg, offset);
|
||||
if (baridx == 0 && size == 1)
|
||||
val = uart_read(dev->arg, offset);
|
||||
return val;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user