mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-06-07 17:46:15 +00:00
hv: dm: fix "Procedure has more than one exit point"
IEC 61508,ISO 26262 standards highly recommend single-exit rule.
Reduce the count of the "return entries".
Fix the violations which is comply with the cases list below:
1.Function has 2 return entries.
2.The first return entry is used to return the error code of
checking variable whether is valid.
Fix the violations in "if else" format.
V1->V2:
make the return value match to int32_t
Tracked-On: #861
Signed-off-by: Huihuang Shi <huihuang.shi@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -34,14 +34,14 @@
|
||||
|
||||
struct pci_vdev;
|
||||
struct pci_vdev_ops {
|
||||
int (*init)(struct pci_vdev *vdev);
|
||||
int32_t (*init)(struct pci_vdev *vdev);
|
||||
|
||||
int (*deinit)(struct pci_vdev *vdev);
|
||||
int32_t (*deinit)(struct pci_vdev *vdev);
|
||||
|
||||
int (*cfgwrite)(struct pci_vdev *vdev, uint32_t offset,
|
||||
uint32_t bytes, uint32_t val);
|
||||
|
||||
int (*cfgread)(struct pci_vdev *vdev, uint32_t offset,
|
||||
int32_t (*cfgread)(struct pci_vdev *vdev, uint32_t offset,
|
||||
uint32_t bytes, uint32_t *val);
|
||||
};
|
||||
|
||||
@@ -125,7 +125,7 @@ struct pci_addr_info {
|
||||
};
|
||||
|
||||
struct vpci_ops {
|
||||
int (*init)(struct acrn_vm *vm);
|
||||
int32_t (*init)(struct acrn_vm *vm);
|
||||
void (*deinit)(struct acrn_vm *vm);
|
||||
void (*cfgread)(struct vpci *vpci, union pci_bdf vbdf, uint32_t offset,
|
||||
uint32_t bytes, uint32_t *val);
|
||||
|
||||
Reference in New Issue
Block a user