hv: guest: 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:
Huihuang Shi
2018-11-28 10:24:26 +08:00
committed by lijinxia
parent c32d41a0be
commit 17a6d9446e
4 changed files with 174 additions and 170 deletions

View File

@@ -193,7 +193,7 @@ struct instr_emul_ctxt {
struct acrn_vcpu *vcpu;
};
int emulate_instruction(const struct acrn_vcpu *vcpu);
int32_t emulate_instruction(const struct acrn_vcpu *vcpu);
int decode_instruction(struct acrn_vcpu *vcpu);
#endif