mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-06-08 18:14:53 +00:00
hv: vpci: fix MISRA-C violations related to variable declarations
78D: Global variable should be declared const. Global variables should be declared constant wherever possible to avoid unintentional modification. 27D: Variable should be declared static pci_ops_vdev_msi is not accessed by other files. Remove the declaration from the header and define it with the static qualifier; Because it's referenced by populate_msi_struct(), so move the define statements forward. 33D: No real declaration for external variable certain variables are available in sharing mode or partition mode only, so that the declarations in header files must be enclosed with CONFIG_PARTITION_MODE Tracked-On: #861 Signed-off-by: Zide Chen <zide.chen@intel.com> Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
@@ -111,7 +111,7 @@ static void partition_mode_cfgwrite(struct acrn_vpci *vpci, union pci_bdf vbdf,
|
||||
}
|
||||
}
|
||||
|
||||
struct vpci_ops partition_mode_vpci_ops = {
|
||||
const struct vpci_ops partition_mode_vpci_ops = {
|
||||
.init = partition_mode_vpci_init,
|
||||
.deinit = partition_mode_vpci_deinit,
|
||||
.cfgread = partition_mode_cfgread,
|
||||
|
||||
Reference in New Issue
Block a user