hv:Fix Implict conversion:actual to formal param

MISRAC has requirement about implict conversion: actual to formal
param. This patch is used to fix part of these violations.

1.Add a new structure seg_desc_vmcs to hold the VMCS field address of
segment selector to clean up seg_desc structure.

2.Add the definition of maximum MSI entry and the relevant judgement.

3.The violations in shell.c, logmsg.c will be fixed in other series of
patches with modification of function snprintf(), vsnprintf() and other
related usages.

v1->v2:
  *Move the definition of struct seg_desc_vmcs from instr_emul.h to
   instr_emul.c.
  *Modify the formal parameter type in function definition from uint8_t
   to char instead of using cast.
  *Drop the const declaration for char data in formal parameter.

v2->v3:
  *update the data missing conversion.
  *change type of internal parameter len to avoid casting in npklog.c.
  *change the conversion from signed char to unsigned int in
   uart16550_getc() to solve sign-extension.

Tracked-On: #861
Signed-off-by: Junjun Shan <junjun.shan@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Junjun Shan
2018-09-17 13:39:40 +08:00
committed by lijinxia
parent 8f0cb5630d
commit eb8c4fb0d5
12 changed files with 80 additions and 56 deletions

View File

@@ -654,9 +654,11 @@ int32_t hcall_remap_pci_msix(struct vm *vm, uint16_t vmid, uint64_t param)
info.vmsi_ctl = remap.msi_ctl;
info.vmsi_addr = remap.msi_addr;
info.vmsi_data = remap.msi_data;
ret = ptdev_msix_remap(target_vm,
remap.virt_bdf, remap.msix_entry_index, &info);
if (remap.msix_entry_index >= MAX_MSI_ENTRY) {
return -1;
}
ret = ptdev_msix_remap(target_vm, remap.virt_bdf,
(uint16_t)remap.msix_entry_index, &info);
remap.msi_data = info.pmsi_data;
remap.msi_addr = info.pmsi_addr;