hv: fix 'No brackets to then/else' in vpci code
This patch addes missing brackets for 'if/else' statements based on
MISRA-C requirements 12 S.
Acked-by: Anthony Xu
@@ -64,7 +64,8 @@ static uint32_t pci_cfg_io_read(struct acrn_vm *vm, uint16_t addr, size_t bytes)
val |= PCI_CFG_ENABLE;
}
}
- } else if (is_cfg_data(addr)) {
+ } else {
+ if (is_cfg_data(addr)) {
if (pi->cached_enable) {
uint16_t offset = addr - PCI_CONFIG_DATA;
@@ -78,6 +79,7 @@ static uint32_t pci_cfg_io_read(struct acrn_vm *vm, uint16_t addr, size_t bytes)
} else {
val = 0xFFFFFFFFU;
}
+ }
return val;
}
@@ -95,7 +97,8 @@ static void pci_cfg_io_write(struct acrn_vm *vm, uint16_t addr, size_t bytes,
pi->cached_reg = val & PCI_REGMAX;
pi->cached_enable = ((val & PCI_CFG_ENABLE) == PCI_CFG_ENABLE);
}
- } else if (is_cfg_data(addr)) {
+ } else {
+ if (is_cfg_data(addr)) {
if (pi->cached_enable) {
uint16_t offset = addr - PCI_CONFIG_DATA;
@@ -109,6 +112,7 @@ static void pci_cfg_io_write(struct acrn_vm *vm, uint16_t addr, size_t bytes,
pr_err("Not PCI cfg data/addr port access!");
}
}
+}
void vpci_init(struct acrn_vm *vm)
{
