From: Jason Gunthorpe Date: Fri, 27 Mar 2020 20:00:18 +0000 (-0300) Subject: mm/hmm: use device_private_entry_to_pfn() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=f66c9a33aee943aa43b3698c1f6f2619e28a1c77;p=linux.git mm/hmm: use device_private_entry_to_pfn() swp_offset() should not be called directly, the wrappers are supposed to abstract away the encoding of the device_private specific information in the swap entry. Link: https://lore.kernel.org/r/20200327200021.29372-7-jgg@ziepe.ca Reviewed-by: Ralph Campbell Reviewed-by: Christoph Hellwig Tested-by: Ralph Campbell Signed-off-by: Jason Gunthorpe --- diff --git a/mm/hmm.c b/mm/hmm.c index 8dbd9e1d0308b..53192c32abc93 100644 --- a/mm/hmm.c +++ b/mm/hmm.c @@ -267,7 +267,7 @@ static int hmm_vma_handle_pte(struct mm_walk *walk, unsigned long addr, */ if (hmm_is_device_private_entry(range, entry)) { *pfn = hmm_device_entry_from_pfn(range, - swp_offset(entry)); + device_private_entry_to_pfn(entry)); *pfn |= range->flags[HMM_PFN_VALID]; if (is_write_device_private_entry(entry)) *pfn |= range->flags[HMM_PFN_WRITE];