hv:Fix unused var value on all paths

MISRAC checks whether a variable is assigned a value not used in
all branches of a program. Var value which is unused on all paths
can be removed with a consequent improvement in the readability
and efficiency of the code. This patch is used to fix these
violations.

Tracked-On: #861
Signed-off-by: Junjun Shan <junjun.shan@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
Junjun Shan
2018-09-19 18:04:29 +08:00
committed by lijinxia
parent f1cce6710a
commit 89ca54cafa
8 changed files with 29 additions and 27 deletions

View File

@@ -60,13 +60,13 @@ static struct trusty_key_info g_key_info = {
static void create_secure_world_ept(struct vm *vm, uint64_t gpa_orig,
uint64_t size, uint64_t gpa_rebased)
{
uint64_t nworld_pml4e = 0UL;
uint64_t sworld_pml4e = 0UL;
uint64_t gpa = 0UL;
uint64_t nworld_pml4e;
uint64_t sworld_pml4e;
uint64_t gpa;
uint64_t hpa = gpa2hpa(vm, gpa_orig);
uint64_t table_present = EPT_RWX;
uint64_t pdpte = 0UL, *dest_pdpte_p = NULL, *src_pdpte_p = NULL;
void *sub_table_addr = NULL, *pml4_base = NULL;
uint64_t pdpte, *dest_pdpte_p, *src_pdpte_p;
void *sub_table_addr, *pml4_base;
struct vm *vm0 = get_vm_from_vmid(0U);
uint16_t i;