mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-09 12:49:24 +00:00
hv: refine a few functions to only one exit point
IEC 61508,ISO 26262 standards highly recommend single-exit rule. 7C: Procedure has more than one exit point. Tracked-On: #861 Signed-off-by: Zide Chen <zide.chen@intel.com> Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
@@ -44,10 +44,11 @@ static uint32_t get_index_of_fixed_mtrr(uint32_t msr)
|
||||
|
||||
for (i = 0U; i < FIXED_RANGE_MTRR_NUM; i++) {
|
||||
if (fixed_mtrr_map[i].msr == msr) {
|
||||
return i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return FIXED_MTRR_INVALID_INDEX;
|
||||
|
||||
return (i < FIXED_RANGE_MTRR_NUM) ? i : FIXED_MTRR_INVALID_INDEX;
|
||||
}
|
||||
|
||||
static uint32_t
|
||||
|
Reference in New Issue
Block a user