hv: coding style: refine page related

1) Fix procedure has more than one exit point.
2) Add some brackets to make logical conjunctions more readable.

Tracked-On: #861
Signed-off-by: Li, Fei1 <fei1.li@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
Li, Fei1
2018-12-19 22:20:08 +08:00
committed by wenlingz
parent 7c2198c422
commit f27aa70fb5
3 changed files with 39 additions and 25 deletions

View File

@@ -4,6 +4,9 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef E820_H
#define E820_H
struct e820_mem_params {
uint64_t mem_bottom;
uint64_t mem_top;
@@ -43,3 +46,5 @@ const struct e820_mem_params *get_e820_mem_info(void);
#define NUM_E820_ENTRIES 5U
extern const struct e820_entry e820_default_entries[NUM_E820_ENTRIES];
#endif
#endif

View File

@@ -20,7 +20,7 @@
#define PT_PAGE_NUM(size) (((size) + PDE_SIZE - 1UL) >> PDE_SHIFT)
/* The size of the guest physical address space, covered by the EPT page table of a VM */
#define EPT_ADDRESS_SPACE(size) ((size != 0UL) ? (size + PLATFORM_LO_MMIO_SIZE) : 0UL)
#define EPT_ADDRESS_SPACE(size) (((size) != 0UL) ? ((size) + PLATFORM_LO_MMIO_SIZE) : 0UL)
#define TRUSTY_PML4_PAGE_NUM(size) (1UL)
#define TRUSTY_PDPT_PAGE_NUM(size) (1UL)