Skip to content

Commit

Permalink
powerpc/mm: Fix compiler warning in pgtable-ppc64.h [-Wunused-but-set…
Browse files Browse the repository at this point in the history
…-variable]

The variable 'old' is set but not used in the wrprotect functions in
arch/powerpc/include/asm/pgtable-ppc64.h, which can trigger a compiler warning.

Remove the variable, since it's not used anyway.

Signed-off-by: Stratos Psomadakis <psomas@ece.ntua.gr>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
  • Loading branch information
Stratos Psomadakis authored and Benjamin Herrenschmidt committed May 19, 2011
1 parent af442a1 commit 2a2c29c
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions arch/powerpc/include/asm/pgtable-ppc64.h
Original file line number Diff line number Diff line change
Expand Up @@ -257,21 +257,20 @@ static inline int __ptep_test_and_clear_young(struct mm_struct *mm,
static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr,
pte_t *ptep)
{
unsigned long old;

if ((pte_val(*ptep) & _PAGE_RW) == 0)
return;
old = pte_update(mm, addr, ptep, _PAGE_RW, 0);
if ((pte_val(*ptep) & _PAGE_RW) == 0)
return;

pte_update(mm, addr, ptep, _PAGE_RW, 0);
}

static inline void huge_ptep_set_wrprotect(struct mm_struct *mm,
unsigned long addr, pte_t *ptep)
{
unsigned long old;

if ((pte_val(*ptep) & _PAGE_RW) == 0)
return;
old = pte_update(mm, addr, ptep, _PAGE_RW, 1);

pte_update(mm, addr, ptep, _PAGE_RW, 1);
}

/*
Expand Down

0 comments on commit 2a2c29c

Please sign in to comment.