mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-30 13:05:45 +00:00
hv: lib: 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. 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:
@@ -78,11 +78,12 @@ static inline uint16_t fls64(uint64_t value)
|
||||
{
|
||||
uint64_t ret = 0UL;
|
||||
if (value == 0UL) {
|
||||
return (INVALID_BIT_INDEX);
|
||||
}
|
||||
asm volatile("bsrq %1,%0"
|
||||
ret = (INVALID_BIT_INDEX);
|
||||
} else {
|
||||
asm volatile("bsrq %1,%0"
|
||||
: "=r" (ret)
|
||||
: "rm" (value));
|
||||
}
|
||||
return (uint16_t)ret;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user