From: Pedro Demarchi Gomes Date: Sat, 4 Oct 2025 03:23:51 +0000 (-0300) Subject: iommu/pages: use folio_nr_pages() instead of shift operation X-Git-Tag: v6.19-rc1~133^2^8~62 X-Git-Url: https://gentwo.org/gitweb/?a=commitdiff_plain;h=db340b02b27c7bd7e5e9a55c700058a7789d8935;p=linux%2F.git iommu/pages: use folio_nr_pages() instead of shift operation folio_nr_pages() is a faster helper function to get the number of pages when NR_PAGES_IN_LARGE_FOLIO is enabled. Signed-off-by: Pedro Demarchi Gomes Reviewed-by: Jason Gunthorpe Signed-off-by: Joerg Roedel --- diff --git a/drivers/iommu/iommu-pages.c b/drivers/iommu/iommu-pages.c index 238c09e5166b..3cb8fcc39066 100644 --- a/drivers/iommu/iommu-pages.c +++ b/drivers/iommu/iommu-pages.c @@ -80,7 +80,7 @@ EXPORT_SYMBOL_GPL(iommu_alloc_pages_node_sz); static void __iommu_free_desc(struct ioptdesc *iopt) { struct folio *folio = ioptdesc_folio(iopt); - const unsigned long pgcnt = 1UL << folio_order(folio); + const unsigned long pgcnt = folio_nr_pages(folio); mod_node_page_state(folio_pgdat(folio), NR_IOMMU_PAGES, -pgcnt); lruvec_stat_mod_folio(folio, NR_SECONDARY_PAGETABLE, -pgcnt);