From d3bd514e58aab12974bb085205cdf83050078828 Mon Sep 17 00:00:00 2001 From: Huihuang Shi Date: Wed, 4 Jul 2018 16:04:40 +0800 Subject: [PATCH] HV:common:add suffix U to the numeric constant Add suffix U to the numeric constant Signed-off-by: Huihuang Shi Acked-by: Eddie Dong --- hypervisor/common/hv_main.c | 2 +- hypervisor/common/hypercall.c | 14 +++++++------- hypervisor/common/io_request.c | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/hypervisor/common/hv_main.c b/hypervisor/common/hv_main.c index 05e80f8a8..2ddf421d2 100644 --- a/hypervisor/common/hv_main.c +++ b/hypervisor/common/hv_main.c @@ -88,7 +88,7 @@ void vcpu_thread(struct vcpu *vcpu) pr_fatal("dispatch VM exit handler failed for reason" " %d, ret = %d!", vcpu->arch_vcpu.exit_reason & 0xFFFFU, ret); - vcpu_inject_gp(vcpu, 0); + vcpu_inject_gp(vcpu, 0U); continue; } diff --git a/hypervisor/common/hypercall.c b/hypervisor/common/hypercall.c index df30cc439..50d1b6d82 100644 --- a/hypervisor/common/hypercall.c +++ b/hypervisor/common/hypercall.c @@ -294,7 +294,7 @@ int64_t hcall_inject_msi(struct vm *vm, uint64_t vmid, uint64_t param) int64_t hcall_set_ioreq_buffer(struct vm *vm, uint64_t vmid, uint64_t param) { int64_t ret = 0; - uint64_t hpa = 0; + uint64_t hpa = 0UL; struct acrn_set_ioreq_buffer iobuf; struct vm *target_vm = get_vm_from_vmid(vmid); @@ -312,7 +312,7 @@ int64_t hcall_set_ioreq_buffer(struct vm *vm, uint64_t vmid, uint64_t param) vmid, iobuf.req_buf); hpa = gpa2hpa(vm, iobuf.req_buf); - if (hpa == 0) { + if (hpa == 0UL) { pr_err("%s: invalid GPA.\n", __func__); target_vm->sw.io_shared_page = NULL; return -EINVAL; @@ -396,7 +396,7 @@ int64_t _set_vm_memmap(struct vm *vm, struct vm *target_vm, uint64_t hpa; uint32_t attr, prot; - if ((memmap->length & 0xFFFUL) != 0) { + if ((memmap->length & 0xFFFUL) != 0UL) { pr_err("%s: ERROR! [vm%d] map size 0x%x is not page aligned", __func__, target_vm->attr.id, memmap->length); return -1; @@ -415,9 +415,9 @@ int64_t _set_vm_memmap(struct vm *vm, struct vm *target_vm, } /* Check prot */ - attr = 0; + attr = 0U; if (memmap->type != MAP_UNMAP) { - prot = (memmap->prot != 0) ? memmap->prot : memmap->prot_2; + prot = (memmap->prot != 0U) ? memmap->prot : memmap->prot_2; if ((prot & MEM_ACCESS_READ) != 0U) attr |= IA32E_EPT_R_BIT; if ((prot & MEM_ACCESS_WRITE) != 0U) @@ -594,7 +594,7 @@ int64_t hcall_assign_ptdev(struct vm *vm, uint64_t vmid, uint64_t param) /* create a iommu domain for target VM if not created */ if (target_vm->iommu_domain == NULL) { - if (target_vm->arch_vm.nworld_eptp == 0) { + if (target_vm->arch_vm.nworld_eptp == 0UL) { pr_err("%s, EPT of VM not set!\n", __func__, target_vm->attr.id); return -EPERM; @@ -778,7 +778,7 @@ int64_t hcall_get_cpu_pm_state(struct vm *vm, uint64_t cmd, uint64_t param) uint8_t cx_idx; struct cpu_cx_data *cx_data; - if (target_vm->pm.cx_cnt == 0) { + if (target_vm->pm.cx_cnt == 0U) { return -1; } diff --git a/hypervisor/common/io_request.c b/hypervisor/common/io_request.c index d13ad951a..5572041ab 100644 --- a/hypervisor/common/io_request.c +++ b/hypervisor/common/io_request.c @@ -168,7 +168,7 @@ void get_req_info(char *str, int str_max) vm = list_entry(pos, struct vm, list); req_buf = (union vhm_request_buffer *)vm->sw.io_shared_page; if (req_buf != NULL) { - for (i = 0; i < VHM_REQUEST_MAX; i++) { + for (i = 0U; i < VHM_REQUEST_MAX; i++) { req = req_buf->req_queue + i; if (req->valid != 0) { _get_req_info_(req, &client_id, type,