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:
Yang, Yu-chu
2018-07-18 18:16:56 -07:00
committed by lijinxia
parent 91337da5a1
commit da0f28c6de
7 changed files with 13 additions and 12 deletions

View File

@@ -649,7 +649,7 @@ uint64_t e820_alloc_low_memory(uint32_t size)
struct e820_entry *entry, *new_entry;
/* We want memory in page boundary and integral multiple of pages */
size = ((size + CPU_PAGE_SIZE - 1U) >> CPU_PAGE_SHIFT)
size = (((size + CPU_PAGE_SIZE) - 1U) >> CPU_PAGE_SHIFT)
<< CPU_PAGE_SHIFT;
for (i = 0U; i < e820_entries; i++) {
@@ -682,8 +682,8 @@ uint64_t e820_alloc_low_memory(uint32_t size)
new_entry = &e820[e820_entries];
new_entry->type = E820_TYPE_RESERVED;
new_entry->baseaddr = end - size;
new_entry->length = entry->baseaddr +
entry->length - new_entry->baseaddr;
new_entry->length = (entry->baseaddr +
entry->length) - new_entry->baseaddr;
/* Shrink the existing entry and total available memory */
entry->length -= new_entry->length;

View File

@@ -48,7 +48,7 @@ void acrn_update_ucode(struct vcpu *vcpu, uint64_t v)
data_size = UCODE_GET_DATA_SIZE(uhdr) + sizeof(struct ucode_header);
data_page_num =
(data_size + CPU_PAGE_SIZE - 1U) >> CPU_PAGE_SHIFT;
((data_size + CPU_PAGE_SIZE) - 1U) >> CPU_PAGE_SHIFT;
ucode_ptr = alloc_pages(data_page_num);
if (ucode_ptr == NULL) {

View File

@@ -481,7 +481,7 @@ bool initialize_trusty(struct vcpu *vcpu, uint64_t param)
/* init secure world environment */
if (init_secure_world_env(vcpu,
trusty_entry_gpa - trusty_base_gpa + TRUSTY_EPT_REBASE_GPA,
(trusty_entry_gpa - trusty_base_gpa) + TRUSTY_EPT_REBASE_GPA,
trusty_base_hpa, trusty_mem_size)) {
/* switch to Secure World */