diff options
author | BALATON Zoltan <balaton@eik.bme.hu> | 2023-05-30 15:28:11 +0200 |
---|---|---|
committer | Daniel Henrique Barboza <danielhb413@gmail.com> | 2023-06-10 10:19:24 -0300 |
commit | bb60364c202d0447fab78653b660a092b11378e4 (patch) | |
tree | c47a01a9ba398956173692b93c1b0ccc22202893 /target | |
parent | a1fa47fad12ea104b2d3f7f8b39f102bc16df539 (diff) |
target/ppc: Simplify ppcemb_tlb_search()
No nead to store return value and break from loop when we can return
directly.
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <d470118c3adcbd41b1a91779f6bb7cbdb2b0d346.1685448535.git.balaton@eik.bme.hu>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Diffstat (limited to 'target')
-rw-r--r-- | target/ppc/mmu_common.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/target/ppc/mmu_common.c b/target/ppc/mmu_common.c index a84bc7de88..ff7f987546 100644 --- a/target/ppc/mmu_common.c +++ b/target/ppc/mmu_common.c @@ -521,19 +521,15 @@ int ppcemb_tlb_search(CPUPPCState *env, target_ulong address, uint32_t pid) { ppcemb_tlb_t *tlb; hwaddr raddr; - int i, ret; + int i; - /* Default return value is no match */ - ret = -1; for (i = 0; i < env->nb_tlb; i++) { tlb = &env->tlb.tlbe[i]; if (ppcemb_tlb_check(env, tlb, &raddr, address, pid, i) == 0) { - ret = i; - break; + return i; } } - - return ret; + return -1; } static int mmu40x_get_physical_address(CPUPPCState *env, mmu_ctx_t *ctx, |