Skip to contentSkip to conversation

powerpc: move common code out of if/else

PATCH In review Jon Tollefson 2 participants 2 messages May 16, 2007 – May 17, 2007 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc: move common code out of if/else

Move common code out of if/else.

----

 hash_native_64.c |    3 +--
 1 files changed, 1 insertion(+), 2 deletions(-)
arch/powerpc/mm/hash_native_64.c +1 -2
index 4a20d89..bb76814 100644
@@ -233,15 +233,14 @@ static long native_hpte_updatepp(unsigned long slot, unsigned long newpp,
        /* Even if we miss, we need to invalidate the TLB */
        if (!HPTE_V_COMPARE(hpte_v, want_v) || !(hpte_v & HPTE_V_VALID)) {
                DBG_LOW(" -> miss\n");
-               native_unlock_hpte(hptep);
                ret = -1;
        } else {
                DBG_LOW(" -> hit\n");
                /* Update the HPTE */
                hptep->r = (hptep->r & ~(HPTE_R_PP | HPTE_R_N)) |
                        (newpp & (HPTE_R_PP | HPTE_R_N | HPTE_R_C));
-               native_unlock_hpte(hptep);
        }
+       native_unlock_hpte(hptep);
 
        /* Ensure it is out of the tlb too. */
        tlbie(va, psize, local);
#1 lore raw

Resubmitting with white space damage repaired.

Move common code out of if/else.

----

hash_native_64.c | 3 +--

1 files changed, 1 insertion(+), 2 deletions(-)
arch/powerpc/mm/hash_native_64.c +0 -0
index 4a20d89..bb76814 100644
@@ -233,15 +233,14 @@ static long native_hpte_updatepp(unsigned long slot, unsigned long newpp,
	/* Even if we miss, we need to invalidate the TLB */
	if (!HPTE_V_COMPARE(hpte_v, want_v) || !(hpte_v & HPTE_V_VALID)) {
		DBG_LOW(" -> miss\n");
-		native_unlock_hpte(hptep);
		ret = -1;
	} else {
		DBG_LOW(" -> hit\n");
		/* Update the HPTE */
		hptep->r = (hptep->r & ~(HPTE_R_PP | HPTE_R_N)) |
			(newpp & (HPTE_R_PP | HPTE_R_N | HPTE_R_C));
-		native_unlock_hpte(hptep);
	}

+ native_unlock_hpte(hptep);

	/* Ensure it is out of the tlb too. */
	tlbie(va, psize, local);