mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-07-31 23:38:24 +00:00
HV: add const qualifier for the deinit vdev op functions
This is to fix the following misra c violation: Pointer param should be declared pointer to const. : vdev Tracked-On: #2534 Signed-off-by: dongshen <dongsheng.x.zhang@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
parent
b2b1a278f0
commit
eb4f46987a
@ -86,7 +86,7 @@ int32_t vdev_hostbridge_init(struct pci_vdev *vdev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t vdev_hostbridge_deinit(__unused struct pci_vdev *vdev)
|
||||
int32_t vdev_hostbridge_deinit(__unused const struct pci_vdev *vdev)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -167,7 +167,7 @@ int32_t vmsi_cfgwrite(struct pci_vdev *vdev, uint32_t offset, uint32_t bytes, ui
|
||||
return ret;
|
||||
}
|
||||
|
||||
int32_t vmsi_deinit(struct pci_vdev *vdev)
|
||||
int32_t vmsi_deinit(const struct pci_vdev *vdev)
|
||||
{
|
||||
if (has_msi_cap(vdev)) {
|
||||
ptirq_remove_msix_remapping(vdev->vpci->vm, vdev->vbdf.value, 1U);
|
||||
|
@ -415,7 +415,7 @@ int32_t vmsix_init(struct pci_vdev *vdev)
|
||||
* @pre vdev->vpci != NULL
|
||||
* @pre vdev->vpci->vm != NULL
|
||||
*/
|
||||
int32_t vmsix_deinit(struct pci_vdev *vdev)
|
||||
int32_t vmsix_deinit(const struct pci_vdev *vdev)
|
||||
{
|
||||
if (has_msix_cap(vdev)) {
|
||||
if (vdev->msix.table_count != 0U) {
|
||||
|
@ -72,12 +72,12 @@ extern const struct vpci_ops partition_mode_vpci_ops;
|
||||
int32_t vdev_hostbridge_init(struct pci_vdev *vdev);
|
||||
int32_t vdev_hostbridge_cfgread(const struct pci_vdev *vdev, uint32_t offset, uint32_t bytes, uint32_t *val);
|
||||
int32_t vdev_hostbridge_cfgwrite(struct pci_vdev *vdev, uint32_t offset, uint32_t bytes, uint32_t val);
|
||||
int32_t vdev_hostbridge_deinit(__unused struct pci_vdev *vdev);
|
||||
int32_t vdev_hostbridge_deinit(__unused const struct pci_vdev *vdev);
|
||||
|
||||
int32_t vdev_pt_init(struct pci_vdev *vdev);
|
||||
int32_t vdev_pt_cfgread(const struct pci_vdev *vdev, uint32_t offset, uint32_t bytes, uint32_t *val);
|
||||
int32_t vdev_pt_cfgwrite(struct pci_vdev *vdev, uint32_t offset, uint32_t bytes, uint32_t val);
|
||||
int32_t vdev_pt_deinit(struct pci_vdev *vdev);
|
||||
int32_t vdev_pt_deinit(const struct pci_vdev *vdev);
|
||||
|
||||
#else
|
||||
extern const struct vpci_ops sharing_mode_vpci_ops;
|
||||
@ -87,12 +87,12 @@ extern const struct pci_vdev_ops pci_ops_vdev_msix;
|
||||
int32_t vmsi_init(struct pci_vdev *vdev);
|
||||
int32_t vmsi_cfgread(const struct pci_vdev *vdev, uint32_t offset, uint32_t bytes, uint32_t *val);
|
||||
int32_t vmsi_cfgwrite(struct pci_vdev *vdev, uint32_t offset, uint32_t bytes, uint32_t val);
|
||||
int32_t vmsi_deinit(struct pci_vdev *vdev);
|
||||
int32_t vmsi_deinit(const struct pci_vdev *vdev);
|
||||
|
||||
int32_t vmsix_init(struct pci_vdev *vdev);
|
||||
int32_t vmsix_cfgread(const struct pci_vdev *vdev, uint32_t offset, uint32_t bytes, uint32_t *val);
|
||||
int32_t vmsix_cfgwrite(struct pci_vdev *vdev, uint32_t offset, uint32_t bytes, uint32_t val);
|
||||
int32_t vmsix_deinit(struct pci_vdev *vdev);
|
||||
int32_t vmsix_deinit(const struct pci_vdev *vdev);
|
||||
#endif
|
||||
|
||||
uint32_t pci_vdev_read_cfg(const struct pci_vdev *vdev, uint32_t offset, uint32_t bytes);
|
||||
|
@ -91,7 +91,7 @@ int32_t vdev_pt_init(struct pci_vdev *vdev)
|
||||
return ret;
|
||||
}
|
||||
|
||||
int32_t vdev_pt_deinit(struct pci_vdev *vdev)
|
||||
int32_t vdev_pt_deinit(const struct pci_vdev *vdev)
|
||||
{
|
||||
int32_t ret;
|
||||
struct acrn_vm *vm = vdev->vpci->vm;
|
||||
|
@ -36,7 +36,7 @@ struct pci_vdev;
|
||||
struct pci_vdev_ops {
|
||||
int32_t (*init)(struct pci_vdev *vdev);
|
||||
|
||||
int32_t (*deinit)(struct pci_vdev *vdev);
|
||||
int32_t (*deinit)(const struct pci_vdev *vdev);
|
||||
|
||||
int32_t (*cfgwrite)(struct pci_vdev *vdev, uint32_t offset,
|
||||
uint32_t bytes, uint32_t val);
|
||||
|
Loading…
Reference in New Issue
Block a user