iommu/amd: Use roundup_pow_two() instead of get_order()
authorJason Gunthorpe <jgg@nvidia.com>
Tue, 8 Apr 2025 16:54:05 +0000 (13:54 -0300)
committerJoerg Roedel <jroedel@suse.de>
Thu, 17 Apr 2025 14:22:47 +0000 (16:22 +0200)
commit5faa04c4edd462cc4ded939cea6f5a995f2ad0ec
tree444f7dc71175efa13577be843ef21f7e273e6e77
parente874c666b15bcb6280c4e747d8de3879bb728829
iommu/amd: Use roundup_pow_two() instead of get_order()

If x >= PAGE_SIZE then:

  1 << (get_order(x) + PAGE_SHIFT) == roundup_pow_two()

Inline this into the only caller, compute the size of the HW device table
in terms of 4K pages which matches the HW definition.

Tested-by: Alejandro Jimenez <alejandro.j.jimenez@oracle.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/17-v4-c8663abbb606+3f7-iommu_pages_jgg@nvidia.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/amd/init.c