mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-18 11:47:30 +00:00
hv: avoid to use "++" or "--" operators in an expression
Use these operators in an expression is considered dangerous. So avoid to use it in an expression which is not in stand-alone expressions and the 3rd expression of a for loop. Tracked-On: #861 Signed-off-by: Li, Fei1 <fei1.li@intel.com>
This commit is contained in:
parent
f33edc67fe
commit
d36b44f23d
@ -106,7 +106,8 @@ static struct pci_vdev *alloc_pci_vdev(struct acrn_vm *vm, union pci_bdf bdf)
|
||||
struct pci_vdev *vdev;
|
||||
|
||||
if (num_pci_vdev < CONFIG_MAX_PCI_DEV_NUM) {
|
||||
vdev = &sharing_mode_vdev_array[num_pci_vdev++];
|
||||
vdev = &sharing_mode_vdev_array[num_pci_vdev];
|
||||
num_pci_vdev++;
|
||||
|
||||
/* vbdf equals to pbdf otherwise remapped */
|
||||
vdev->vbdf = bdf;
|
||||
@ -186,7 +187,8 @@ void add_vdev_handler(struct pci_vdev *vdev, struct pci_vdev_ops *ops)
|
||||
if (vdev->nr_ops >= (MAX_VPCI_DEV_OPS - 1U)) {
|
||||
pr_err("%s, adding too many handlers", __func__);
|
||||
} else {
|
||||
vdev->ops[vdev->nr_ops++] = *ops;
|
||||
vdev->ops[vdev->nr_ops] = *ops;
|
||||
vdev->nr_ops++;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user