hv: fix MISRA-C violations in vpci code: 93S, 331S and 612S

- 331S: Literal value requires a U suffix.
- 612S: inline function should be declared static.
- 93S: Value is not of appropriate type. MISRA-C imposes strict type
  checking: no comparison between signed and unsigned, etc.

Tracked-On: #861
Signed-off-by: Zide Chen <zide.chen@intel.com>
Reviewed-by: Huihuang Shi <huihuang.shi@intel.com>
This commit is contained in:
Zide Chen
2018-11-06 22:09:15 -08:00
committed by wenlingz
parent f84f1a216b
commit d3f0edfe4f
6 changed files with 11 additions and 14 deletions

View File

@@ -242,14 +242,14 @@ static int vmsix_table_mmio_access_handler(struct io_request *io_req, void *hand
{
struct mmio_request *mmio = &io_req->reqs.mmio;
struct pci_vdev *vdev;
uint32_t offset;
uint64_t offset;
uint64_t hva;
vdev = (struct pci_vdev *)handler_private_data;
offset = (uint32_t)(mmio->address - vdev->msix.mmio_gpa);
offset = mmio->address - vdev->msix.mmio_gpa;
if (msixtable_access(vdev, offset)) {
vmsix_table_rw(vdev, mmio, offset);
if (msixtable_access(vdev, (uint32_t)offset)) {
vmsix_table_rw(vdev, mmio, (uint32_t)offset);
} else {
hva = vdev->msix.mmio_hva + offset;