Commit 5faa04c
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>1 parent e874c66 commit 5faa04c
1 file changed
Lines changed: 3 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | 246 | | |
255 | 247 | | |
256 | 248 | | |
| |||
1595 | 1587 | | |
1596 | 1588 | | |
1597 | 1589 | | |
1598 | | - | |
| 1590 | + | |
| 1591 | + | |
| 1592 | + | |
1599 | 1593 | | |
1600 | 1594 | | |
1601 | 1595 | | |
| |||
0 commit comments