diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2017-11-02 18:36:25 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2017-11-02 19:12:09 -0400 |
commit | 6497c2baf2c66938bfff51af9806d495bbb506f9 (patch) | |
tree | e856108738a2591bea9c0297095bcd11e1a7ed99 | |
parent | 46bda4f4af5d061ce07148e833ff4deb50737536 (diff) |
drm/nouveau/mmu: swap out round for ALIGN
Rounding value is guaranteed to be power-of-two, so this is better
anyway.
Fixes build on 32-bit.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c index 6446bc61b084..e35d3e17cd7c 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmm.c | |||
@@ -1349,12 +1349,12 @@ nvkm_vmm_get_locked(struct nvkm_vmm *vmm, bool getref, bool mapref, bool sparse, | |||
1349 | 1349 | ||
1350 | addr = this->addr; | 1350 | addr = this->addr; |
1351 | if (vmm->func->page_block && prev && prev->page != p) | 1351 | if (vmm->func->page_block && prev && prev->page != p) |
1352 | addr = roundup(addr, vmm->func->page_block); | 1352 | addr = ALIGN(addr, vmm->func->page_block); |
1353 | addr = ALIGN(addr, 1ULL << align); | 1353 | addr = ALIGN(addr, 1ULL << align); |
1354 | 1354 | ||
1355 | tail = this->addr + this->size; | 1355 | tail = this->addr + this->size; |
1356 | if (vmm->func->page_block && next && next->page != p) | 1356 | if (vmm->func->page_block && next && next->page != p) |
1357 | tail = rounddown(tail, vmm->func->page_block); | 1357 | tail = ALIGN_DOWN(addr, vmm->func->page_block); |
1358 | 1358 | ||
1359 | if (addr <= tail && tail - addr >= size) { | 1359 | if (addr <= tail && tail - addr >= size) { |
1360 | rb_erase(&this->tree, &vmm->free); | 1360 | rb_erase(&this->tree, &vmm->free); |