mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-01-05 07:35:31 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user