hv: boot: fix "Procedure has more than one exit point"

IEC 61508,ISO 26262 standards highly recommend single-exit rule.

Reduce the count of the "return entries".
Fix the violations which is comply with the cases list below:
1.Function has 2 return entries.
2.The first return entry is used to return the error code of
checking variable whether is valid.

Fix the violations in "if else" format.
V1->V2:
    change the probe_table return value to bool type

Tracked-On: #861
Signed-off-by: Huihuang Shi <huihuang.shi@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Huihuang Shi
2018-11-28 10:21:09 +08:00
committed by lijinxia
parent a1ac585b85
commit ab3d7c87fd
2 changed files with 10 additions and 7 deletions

View File

@@ -149,10 +149,10 @@ static void *get_kernel_load_addr(void *kernel_src_addr)
*/
zeropage = (struct zero_page *)kernel_src_addr;
if (zeropage->hdr.relocatable_kernel != 0U) {
return (void *)zeropage->hdr.pref_addr;
zeropage = (void *)zeropage->hdr.pref_addr;
}
return kernel_src_addr;
return zeropage;
}
/**