Re: [PATCH] LoongArch: Use __pmd() helper for __swp_entry_to_pmd()

From: WangYuli

Date: Wed Dec 03 2025 - 05:05:15 EST


Hi Huacai,

On 2025/12/3 17:46, Huacai Chen wrote:
diff --git a/arch/loongarch/include/asm/pgtable.h b/arch/loongarch/include/asm/pgtable.h
index 03fb60432fde..4e09f7e8bbec 100644
--- a/arch/loongarch/include/asm/pgtable.h
+++ b/arch/loongarch/include/asm/pgtable.h
@@ -299,7 +299,7 @@ static inline pte_t mk_swap_pte(unsigned long type, unsigned long offset)
#define __pte_to_swp_entry(pte) ((swp_entry_t) { pte_val(pte) })
#define __swp_entry_to_pte(x) ((pte_t) { (x).val })
Why not change __swp_entry_to_pte() together with __pte()?

Huacai

I haven't investigated this closely, but it's odd that changing just this one spot was enough to get it to compile — there doesn't seem to be an error at __swp_entry_to_pte.

But you're right that changing both together looks neater.

If you think it's necessary, I'm happy to submit a patch v2.

Thanks,

--

WangYuli