From bad813ea313cf53e61f3f168d70c75bb4077d773 Mon Sep 17 00:00:00 2001 From: Zide Chen Date: Tue, 6 Nov 2018 15:41:00 -0800 Subject: [PATCH] hv: fix MISRA-C violations in vpci code: Function pointer is of wrong type 576S: Function pointer is of wrong type. C90 requires the elements of an designated initializer to appear in a fixed order, the same as the order of declaration. C99 relaxes this rule but seems MISRA-C sticks to C90 in this regard. Tracked-On: #861 Signed-off-by: Zide Chen Acked-by: Anthony Xu Reviewed-by: Huihuang Shi --- hypervisor/dm/vpci/hostbridge.c | 2 +- hypervisor/dm/vpci/msi.c | 1 - hypervisor/dm/vpci/pci_pt.c | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/hypervisor/dm/vpci/hostbridge.c b/hypervisor/dm/vpci/hostbridge.c index cdde74244..e0f7f3eb9 100644 --- a/hypervisor/dm/vpci/hostbridge.c +++ b/hypervisor/dm/vpci/hostbridge.c @@ -121,7 +121,7 @@ static int vdev_hostbridge_cfgwrite(struct pci_vdev *vdev, uint32_t offset, struct pci_vdev_ops pci_ops_vdev_hostbridge = { .init = vdev_hostbridge_init, .deinit = vdev_hostbridge_deinit, - .cfgread = vdev_hostbridge_cfgread, .cfgwrite = vdev_hostbridge_cfgwrite, + .cfgread = vdev_hostbridge_cfgread, }; diff --git a/hypervisor/dm/vpci/msi.c b/hypervisor/dm/vpci/msi.c index a94aaf6dd..ca4b791ef 100644 --- a/hypervisor/dm/vpci/msi.c +++ b/hypervisor/dm/vpci/msi.c @@ -223,7 +223,6 @@ static int vmsi_deinit(struct pci_vdev *vdev) } struct pci_vdev_ops pci_ops_vdev_msi = { - .init = NULL, .deinit = vmsi_deinit, .cfgwrite = vmsi_cfgwrite, .cfgread = vmsi_cfgread, diff --git a/hypervisor/dm/vpci/pci_pt.c b/hypervisor/dm/vpci/pci_pt.c index 538f9dc54..b6d5bcdac 100644 --- a/hypervisor/dm/vpci/pci_pt.c +++ b/hypervisor/dm/vpci/pci_pt.c @@ -198,7 +198,7 @@ static int vdev_pt_cfgwrite(struct pci_vdev *vdev, uint32_t offset, struct pci_vdev_ops pci_ops_vdev_pt = { .init = vdev_pt_init, .deinit = vdev_pt_deinit, - .cfgread = vdev_pt_cfgread, .cfgwrite = vdev_pt_cfgwrite, + .cfgread = vdev_pt_cfgread, };