hv:treewide:fix multiple MISRAC violations

MISRAC has requirements about literal value requires a U suffix and
signed/unsigned conversion with cast. This patch is used to solve
these violations.

v1->v2
 *Drop the cast of sz from uint32_t to int32_t, the signed/unsigned
  violation of nchars will be solved by other patch together with
  printf/sprintf/console/vuart/uart code.

 *Delete the unnecessary L suffix of shifting operand.

Tracked-On: #861
Signed-off-by: Junjun Shan <junjun.shan@intel.com>
Reviewed by: Junjie Mao <junjie.mao@intel.com>
This commit is contained in:
Junjun Shan
2018-09-11 10:56:05 +08:00
committed by lijinxia
parent 00edd838c9
commit 4fd5102edc
15 changed files with 50 additions and 50 deletions

View File

@@ -261,7 +261,7 @@ static uint64_t pit_calibrate_tsc(uint32_t cal_ms_arg)
*/
static uint64_t native_calibrate_tsc(void)
{
uint64_t tsc_hz = 0;
uint64_t tsc_hz = 0UL;
if (boot_cpu_data.cpuid_level >= 0x15U) {
uint32_t eax_denominator, ebx_numerator, ecx_hz, reserved;
@@ -275,7 +275,7 @@ static uint64_t native_calibrate_tsc(void)
}
}
if ((tsc_hz == 0) && (boot_cpu_data.cpuid_level >= 0x16U)) {
if ((tsc_hz == 0UL) && (boot_cpu_data.cpuid_level >= 0x16U)) {
uint32_t eax_base_mhz, ebx_max_mhz, ecx_bus_mhz, edx;
cpuid(0x16U, &eax_base_mhz, &ebx_max_mhz, &ecx_bus_mhz, &edx);
tsc_hz = (uint64_t) eax_base_mhz * 1000000U;