diff mbox

instmem/gk20a: use roundup() macro

Message ID 1424922292-20688-2-git-send-email-acourbot@nvidia.com
State Not Applicable, archived
Headers show

Commit Message

Alexandre Courbot Feb. 26, 2015, 3:44 a.m. UTC
Use the roundup() macro to make code easier to read and fix a warning
when the driver is compiled for 64 bit architectures.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
---
Ben, this should probably be squashed into patch 6/6 of my "RAM device
removal & IOMMU support" series, since it is not merged yet.

 drm/nouveau/nvkm/subdev/instmem/gk20a.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/drm/nouveau/nvkm/subdev/instmem/gk20a.c b/drm/nouveau/nvkm/subdev/instmem/gk20a.c
index a31196b6da8f..fcba72eb74a3 100644
--- a/drm/nouveau/nvkm/subdev/instmem/gk20a.c
+++ b/drm/nouveau/nvkm/subdev/instmem/gk20a.c
@@ -335,8 +335,8 @@  gk20a_instobj_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
 		 priv->domain ? "IOMMU" : "DMA", args->size, args->align);
 
 	/* Round size and align to page bounds */
-	size = max((args->size  + ~PAGE_MASK) & PAGE_MASK, (u32)PAGE_SIZE);
-	align = max((args->align + ~PAGE_MASK) & PAGE_MASK, (u32)PAGE_SIZE);
+	size = max(roundup(args->size, PAGE_SIZE), PAGE_SIZE);
+	align = max(roundup(args->align, PAGE_SIZE), PAGE_SIZE);
 
 	if (priv->domain)
 		ret = gk20a_instobj_ctor_iommu(parent, engine, oclass,