Skip to content

Commit e0e51a0

Browse files
author
Paul Walmsley
committed
riscv: mm: use xchg() on non-atomic_long_t variables, not atomic_long_xchg()
Let's not call atomic_long_xchg() on something that's not an atomic_long_t, and just use xchg() instead. Continues the cleanup from commit 546e42c ("riscv: Use an atomic xchg in pudp_huge_get_and_clear()"), Cc: Alexandre Ghiti <alex@ghiti.fr> Signed-off-by: Paul Walmsley <pjw@kernel.org>
1 parent 425cc08 commit e0e51a0

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

arch/riscv/include/asm/pgtable.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ static inline pte_t ptep_get_and_clear(struct mm_struct *mm,
661661
unsigned long address, pte_t *ptep)
662662
{
663663
#ifdef CONFIG_SMP
664-
pte_t pte = __pte(atomic_long_xchg((atomic_long_t *)ptep, 0));
664+
pte_t pte = __pte(xchg(&ptep->pte, 0));
665665
#else
666666
pte_t pte = *ptep;
667667

@@ -1004,7 +1004,7 @@ static inline pmd_t pmdp_huge_get_and_clear(struct mm_struct *mm,
10041004
unsigned long address, pmd_t *pmdp)
10051005
{
10061006
#ifdef CONFIG_SMP
1007-
pmd_t pmd = __pmd(atomic_long_xchg((atomic_long_t *)pmdp, 0));
1007+
pmd_t pmd = __pmd(xchg(&pmdp->pmd, 0));
10081008
#else
10091009
pmd_t pmd = *pmdp;
10101010

0 commit comments

Comments
 (0)