Skip to content

Commit

Permalink
target/mips: Remove identical if/else branches
Browse files Browse the repository at this point in the history
Remove the segment:

      if (other_tc == other->current_tc) {
          tccause = other->CP0_Cause;
      } else {
          tccause = other->CP0_Cause;
      }

Original contributor can't remember what was his intention.

Fixes: 5a25ce9 ("mips: Hook in more reg accesses via mttr/mftr")
Buglink: https://bugs.launchpad.net/qemu/+bug/1885718
Signed-off-by: Aleksandar Markovic <aleksandar.qemu.devel@gmail.com>
Message-Id: <20200701182559.28841-2-aleksandar.qemu.devel@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
  • Loading branch information
AMarkovic authored and philmd committed Jul 14, 2020
1 parent 1a53dfe commit 9788e8c
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions target/mips/cp0_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -375,16 +375,9 @@ target_ulong helper_mftc0_entryhi(CPUMIPSState *env)
target_ulong helper_mftc0_cause(CPUMIPSState *env)
{
int other_tc = env->CP0_VPEControl & (0xff << CP0VPECo_TargTC);
int32_t tccause;
CPUMIPSState *other = mips_cpu_map_tc(env, &other_tc);

if (other_tc == other->current_tc) {
tccause = other->CP0_Cause;
} else {
tccause = other->CP0_Cause;
}

return tccause;
return other->CP0_Cause;
}

target_ulong helper_mftc0_status(CPUMIPSState *env)
Expand Down

0 comments on commit 9788e8c

Please sign in to comment.