Skip to content

Commit daf78a9

Browse files
bibo-maoMarkus Armbruster
authored andcommitted
target/loongarch: Remove unnecessary temporary variable assignment
Temporary variable ret is assigned at last line and return, it can be removed and return directly. Signed-off-by: Bibo Mao <[email protected]> Reviewed-by: Markus Armbruster <[email protected]> Reviewed-by: Philippe Mathieu-Daudé <[email protected]> Message-ID: <[email protected]> Signed-off-by: Markus Armbruster <[email protected]>
1 parent 0973b50 commit daf78a9

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

target/loongarch/tcg/tlb_helper.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ target_ulong helper_lddir(CPULoongArchState *env, target_ulong base,
543543
target_ulong level, uint32_t mem_idx)
544544
{
545545
CPUState *cs = env_cpu(env);
546-
target_ulong badvaddr, index, phys, ret;
546+
target_ulong badvaddr, index, phys;
547547
uint64_t dir_base, dir_width;
548548

549549
if (unlikely((level == 0) || (level > 4))) {
@@ -571,8 +571,7 @@ target_ulong helper_lddir(CPULoongArchState *env, target_ulong base,
571571
get_dir_base_width(env, &dir_base, &dir_width, level);
572572
index = (badvaddr >> dir_base) & ((1 << dir_width) - 1);
573573
phys = base | index << 3;
574-
ret = ldq_phys(cs->as, phys) & TARGET_PHYS_MASK;
575-
return ret;
574+
return ldq_phys(cs->as, phys) & TARGET_PHYS_MASK;
576575
}
577576

578577
void helper_ldpte(CPULoongArchState *env, target_ulong base, target_ulong odd,

0 commit comments

Comments
 (0)