mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-01-05 07:35:31 +00:00
HV: Bracket for the same level of precendence
The plus and minor have the same level of precedence. The Misra-C considers it as a violation. Added brackets in between addition and substraction oprators. Signed-off-by: Yang, Yu-chu <yu-chu.yang@intel.com> Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
@@ -245,7 +245,7 @@ void *malloc(unsigned int num_bytes)
|
||||
memory = allocate_mem(&Memory_Pool, num_bytes);
|
||||
} else {
|
||||
uint32_t page_num =
|
||||
(num_bytes + CPU_PAGE_SIZE - 1U) >> CPU_PAGE_SHIFT;
|
||||
((num_bytes + CPU_PAGE_SIZE) - 1U) >> CPU_PAGE_SHIFT;
|
||||
/* Request memory allocation through alloc_page */
|
||||
memory = alloc_pages(page_num);
|
||||
}
|
||||
@@ -361,8 +361,8 @@ void *memcpy_s(void *d, size_t dmax, const void *s, size_t slen)
|
||||
ASSERT(false);
|
||||
}
|
||||
|
||||
if (((d > s) && (d <= (s + slen - 1U)))
|
||||
|| ((d < s) && (s <= (d + dmax - 1U)))) {
|
||||
if (((d > s) && (d <= ((s + slen) - 1U)))
|
||||
|| ((d < s) && (s <= ((d + dmax) - 1U)))) {
|
||||
ASSERT(false);
|
||||
}
|
||||
|
||||
|
||||
@@ -335,7 +335,7 @@ static int print_pow2(struct print_param *param,
|
||||
|
||||
/* assign parameter and apply width and precision */
|
||||
param->vars.value = pos;
|
||||
param->vars.valuelen = digitbuff + sizeof(digitbuff) - pos;
|
||||
param->vars.valuelen = (digitbuff + sizeof(digitbuff)) - pos;
|
||||
|
||||
ret = format_number(param);
|
||||
|
||||
@@ -408,7 +408,7 @@ static int print_decimal(struct print_param *param, int64_t value)
|
||||
|
||||
/* assign parameter and apply width and precision */
|
||||
param->vars.value = pos;
|
||||
param->vars.valuelen = digitbuff + sizeof(digitbuff) - pos;
|
||||
param->vars.valuelen = (digitbuff + sizeof(digitbuff)) - pos;
|
||||
|
||||
ret = format_number(param);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user