From b79f35097756d8f6e6e118b3f7b924a188a9c49b Mon Sep 17 00:00:00 2001 From: Xiangyang Wu Date: Mon, 9 Jul 2018 15:13:14 +0800 Subject: [PATCH] HV:CPU: Add 'U/UL' for constant value in CPU module There are unsinged constant values don't have 'U/UL' suffix in the HV reported by static analysis tool. Add 'U/UL' suffix for unsigned constant values as needed. Tracked-on: ccm0001001-247033 Signed-off-by: Xiangyang Wu Reviewed-by: Junjie Mao --- hypervisor/arch/x86/cpu.c | 4 ++-- hypervisor/include/arch/x86/cpuid.h | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/hypervisor/arch/x86/cpu.c b/hypervisor/arch/x86/cpu.c index c9d6cae9d..20ff9dc6a 100644 --- a/hypervisor/arch/x86/cpu.c +++ b/hypervisor/arch/x86/cpu.c @@ -723,7 +723,7 @@ void start_cpus() /* Wait until global count is equal to expected CPU up count or * configured time-out has expired */ - timeout = CONFIG_CPU_UP_TIMEOUT * 1000; + timeout = CONFIG_CPU_UP_TIMEOUT * 1000U; while ((up_count != expected_up) && (timeout != 0U)) { /* Delay 10us */ udelay(10U); @@ -748,7 +748,7 @@ void stop_cpus() uint16_t pcpu_id, expected_up; uint32_t timeout; - timeout = CONFIG_CPU_UP_TIMEOUT * 1000; + timeout = CONFIG_CPU_UP_TIMEOUT * 1000U; for (pcpu_id = 0U; pcpu_id < phys_cpu_num; pcpu_id++) { if (get_cpu_id() == pcpu_id) /* avoid offline itself */ continue; diff --git a/hypervisor/include/arch/x86/cpuid.h b/hypervisor/include/arch/x86/cpuid.h index a5a69e0b3..e3e1b6d4d 100644 --- a/hypervisor/include/arch/x86/cpuid.h +++ b/hypervisor/include/arch/x86/cpuid.h @@ -84,11 +84,11 @@ #define CPUID_ECX_PCID (1U<<17) /* CPUID source operands */ -#define CPUID_VENDORSTRING 0 -#define CPUID_FEATURES 1 -#define CPUID_TLB 2 -#define CPUID_SERIALNUM 3 -#define CPUID_EXTEND_FEATURE 7 +#define CPUID_VENDORSTRING 0U +#define CPUID_FEATURES 1U +#define CPUID_TLB 2U +#define CPUID_SERIALNUM 3U +#define CPUID_EXTEND_FEATURE 7U #define CPUID_MAX_EXTENDED_FUNCTION 0x80000000U #define CPUID_EXTEND_FUNCTION_1 0x80000001U #define CPUID_EXTEND_FUNCTION_2 0x80000002U