On 2/26/25 03:39, Jason Gunthorpe wrote:
If all the inlines are unwound virt_to_dma_pfn() is simply: return page_to_pfn(virt_to_page(p)) << (PAGE_SHIFT - VTD_PAGE_SHIFT); Which can be re-arranged to: (page_to_pfn(virt_to_page(p)) << PAGE_SHIFT) >> VTD_PAGE_SHIFT The only caller is: ((uint64_t)virt_to_dma_pfn(tmp_page) << VTD_PAGE_SHIFT) re-arranged to: ((page_to_pfn(virt_to_page(tmp_page)) << PAGE_SHIFT) >> VTD_PAGE_SHIFT) << VTD_PAGE_SHIFT Which simplifies to: page_to_pfn(virt_to_page(tmp_page)) << PAGE_SHIFT That is the same as virt_to_phys(tmp_page), so just remove all of this. Reviewed-by: Lu Baolu<baolu.lu@xxxxxxxxxxxxxxx> Signed-off-by: Jason Gunthorpe<jgg@xxxxxxxxxx> --- drivers/iommu/intel/iommu.c | 3 ++- drivers/iommu/intel/iommu.h | 19 ------------------- 2 files changed, 2 insertions(+), 20 deletions(-)
Queued this cleanup patch for iommu/vt-d. Thanks, baolu