mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-05 19:00:16 +00:00
hv: other: 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:
@@ -81,13 +81,15 @@ static inline void pio_write(uint32_t v, uint16_t addr, size_t sz)
|
||||
|
||||
static inline uint32_t pio_read(uint16_t addr, size_t sz)
|
||||
{
|
||||
uint32_t ret;
|
||||
if (sz == 1U) {
|
||||
return pio_read8(addr);
|
||||
ret = pio_read8(addr);
|
||||
} else if (sz == 2U) {
|
||||
ret = pio_read16(addr);
|
||||
} else {
|
||||
ret = pio_read32(addr);
|
||||
}
|
||||
if (sz == 2U) {
|
||||
return pio_read16(addr);
|
||||
}
|
||||
return pio_read32(addr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/** Writes a 64 bit value to a memory mapped IO device.
|
||||
|
Reference in New Issue
Block a user