summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorZhen Lei <thunder.leizhen@huawei.com>2017-09-21 16:52:43 +0100
committerJoerg Roedel <jroedel@suse.de>2017-09-27 17:09:56 +0200
commit086c83acb70fc6da044c9ca45c1c9780c64545b0 (patch)
tree0f3e852600d7c60bad9b8bd0e8fbd1a710293de8 /include/linux
parent2070f940a6d5148cf2df0d0087ff0a64d9f15237 (diff)
iommu/iova: Optimise the padding calculation
The mask for calculating the padding size doesn't change, so there's no need to recalculate it every loop iteration. Furthermore, Once we've done that, it becomes clear that we don't actually need to calculate a padding size at all - by flipping the arithmetic around, we can just combine the upper limit, size, and mask directly to check against the lower limit. For an arm64 build, this alone knocks 20% off the object code size of the entire alloc_iova() function! Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Tested-by: Zhen Lei <thunder.leizhen@huawei.com> Tested-by: Nate Watterson <nwatters@codeaurora.org> [rm: simplified more of the arithmetic, rewrote commit message] Signed-off-by: Robin Murphy <robin.murphy@arm.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions