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

@@ -69,7 +69,7 @@ static uint8_t mpt_compute_checksum(const void *base, size_t len)
{
uint8_t sum = 0U;
size_t length;
const uint8_t *bytes = base;
const uint8_t *bytes = (const uint8_t *)base;
for (length = len; length > 0U; length--) {
sum += *bytes;
@@ -109,7 +109,7 @@ int32_t mptable_build(struct acrn_vm *vm)
+ MPE_NUM_BUSES * (uint16_t)sizeof(struct bus_entry)
+ MPEII_NUM_LOCAL_IRQ * (uint16_t)sizeof(struct int_entry);
mptable_length = sizeof(struct mpfps) + mptable->mpch.base_table_length;
mptable_length = sizeof(struct mpfps) + (uint32_t)mptable->mpch.base_table_length;
if (mptable_length <= MPTABLE_MAX_LENGTH) {
for (i = 0U; i < vcpu_num; i++) {
uint16_t pcpu_id = ffs64(pcpu_bitmap);