mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-01-06 16:15:00 +00:00
HV: treewide: fix violations of coding guideline C-TY-27 & C-TY-28
The coding guideline rules C-TY-27 and C-TY-28, combined, requires that assignment and arithmetic operations shall be applied only on operands of the same kind. This patch either adds explicit type casts or adjust types of variables to align the types of operands. The only semantic change introduced by this patch is the promotion of the second argument of set_vmcs_bit() and clear_vmcs_bit() to uint64_t (formerly uint32_t). This avoids clear_vmcs_bit() to accidentally clears the upper 32 bits of the requested VMCS field. Other than that, this patch has no semantic change. Specifically this patch is not meant to fix buggy narrowing operations, only to make these operations explicit. Tracked-On: #6776 Signed-off-by: Junjie Mao <junjie.mao@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -10,12 +10,12 @@
|
||||
#include <efi_mmap.h>
|
||||
#include <logmsg.h>
|
||||
|
||||
static uint16_t hv_memdesc_nr;
|
||||
static uint32_t hv_memdesc_nr;
|
||||
static struct efi_memory_desc hv_memdesc[CONFIG_MAX_EFI_MMAP_ENTRIES];
|
||||
|
||||
static void sort_efi_mmap_entries(void)
|
||||
{
|
||||
uint32_t i,j;
|
||||
uint32_t i, j;
|
||||
struct efi_memory_desc tmp_memdesc;
|
||||
|
||||
/* Bubble sort */
|
||||
|
||||
@@ -91,7 +91,7 @@ int32_t hcall_service_vm_offline_cpu(struct acrn_vcpu *vcpu, __unused struct acr
|
||||
struct acrn_vcpu *target_vcpu;
|
||||
uint16_t i;
|
||||
int32_t ret = 0;
|
||||
uint64_t lapicid = param1;
|
||||
uint32_t lapicid = (uint32_t)param1;
|
||||
|
||||
pr_info("Service VM offline cpu with lapicid %ld", lapicid);
|
||||
|
||||
@@ -208,7 +208,7 @@ int32_t hcall_get_platform_info(struct acrn_vcpu *vcpu, __unused struct acrn_vm
|
||||
get_cache_shift(&pi.hw.l2_cat_shift, &pi.hw.l3_cat_shift);
|
||||
|
||||
for (i = 0U; i < min(pcpu_nums, ACRN_PLATFORM_LAPIC_IDS_MAX); i++) {
|
||||
pi.hw.lapic_ids[i] = per_cpu(lapic_id, i);
|
||||
pi.hw.lapic_ids[i] = (uint8_t)per_cpu(lapic_id, i);
|
||||
}
|
||||
|
||||
pi.hw.cpu_num = pcpu_nums;
|
||||
|
||||
Reference in New Issue
Block a user