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,