From: Christoph Hellwig Date: Mon, 26 Aug 2019 09:23:44 +0000 (+0200) Subject: swiotlb-xen: use the same foreign page check everywhere X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=c9b6180dbf9ab3fef15ec5482997c99b0c762cd1;p=linux.git swiotlb-xen: use the same foreign page check everywhere xen_dma_map_page uses a different and more complicated check for foreign pages than the other three cache maintainance helpers. Switch it to the simpler pfn_valid method a well, and document the scheme with a single improved comment in xen_dma_map_page. Signed-off-by: Christoph Hellwig Reviewed-by: Stefano Stabellini --- diff --git a/include/xen/arm/page-coherent.h b/include/xen/arm/page-coherent.h index a840d6949a87c..a8d9c0678c27b 100644 --- a/include/xen/arm/page-coherent.h +++ b/include/xen/arm/page-coherent.h @@ -53,23 +53,17 @@ static inline void xen_dma_map_page(struct device *hwdev, struct page *page, dma_addr_t dev_addr, unsigned long offset, size_t size, enum dma_data_direction dir, unsigned long attrs) { - unsigned long page_pfn = page_to_xen_pfn(page); - unsigned long dev_pfn = XEN_PFN_DOWN(dev_addr); - unsigned long compound_pages = - (1<