hv: fix Violations touched ACRN Coding Guidelines

fix violations touched below:
1.Cast operation on a constant value
2.signed/unsigned implicity conversion
3.return value unused.

V1->V2:
1.bitmap api will return boolean type, not need to check "!= 0", deleted.
2.The behaves ~(uint32_t)X and (uint32_t)~X are not defined in ACRN hypervisor Coding Guidelines,
removed the change of it.
Tracked-On: #861
Signed-off-by: Huihuang Shi <huihuang.shi@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
This commit is contained in:
huihuang.shi
2019-08-14 16:34:29 +08:00
committed by ACRN System Integration
parent f1b71d983a
commit f147c388a5
12 changed files with 31 additions and 30 deletions

View File

@@ -454,7 +454,7 @@ void vcpu_set_rip(struct acrn_vcpu *vcpu, uint64_t val);
*
* @return the value of RSP.
*/
uint64_t vcpu_get_rsp(struct acrn_vcpu *vcpu);
uint64_t vcpu_get_rsp(const struct acrn_vcpu *vcpu);
/**
* @brief set vcpu RSP value
@@ -546,7 +546,7 @@ void vcpu_set_guest_msr(struct acrn_vcpu *vcpu, uint32_t msr, uint64_t val);
*
* @return None
*/
void vcpu_set_vmcs_eoi_exit(struct acrn_vcpu *vcpu);
void vcpu_set_vmcs_eoi_exit(const struct acrn_vcpu *vcpu);
/**
* @brief reset all eoi_exit_bitmaps

View File

@@ -184,7 +184,7 @@ void vlapic_receive_intr(struct acrn_vm *vm, bool level, uint32_t dest,
bool phys, uint32_t delmode, uint32_t vec, bool rh);
uint32_t vlapic_get_apicid(const struct acrn_vlapic *vlapic);
int32_t vlapic_create(struct acrn_vcpu *vcpu);
void vlapic_create(struct acrn_vcpu *vcpu);
/*
* @pre vcpu != NULL
*/

View File

@@ -31,8 +31,8 @@ struct per_cpu_region {
uint64_t irq_count[NR_IRQS];
uint64_t softirq_pending;
uint64_t spurious;
void *vcpu;
void *ever_run_vcpu;
struct acrn_vcpu *vcpu;
struct acrn_vcpu *ever_run_vcpu;
#ifdef STACK_PROTECTOR
struct stack_canary stk_canary;
#endif