From f5895f44eaaa095018736ecf607cb3fcbce66476 Mon Sep 17 00:00:00 2001 From: Deepak Nibade Date: Wed, 31 Aug 2016 18:01:09 +0530 Subject: gpu: nvgpu: fix compilation errors for 32 bit arch Converting return value of sg_dma_address() (which is u64) into a pointer results in compilation failure on 32 bit machines Hence convert address first into uintptr_t and then into pointer Change-Id: I8e036af8f4c936b88883cf8af1491f03025ed356 Signed-off-by: Deepak Nibade Reviewed-on: http://git-master/r/1211243 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/mm_gk20a.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c index 08fbfb80..876f3115 100644 --- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c @@ -148,7 +148,8 @@ static inline void pramin_access_batched(struct gk20a *g, struct mem_desc *mem, struct page_alloc_chunk *chunk = NULL; u32 byteoff, start_reg, until_end, n; - alloc = (struct gk20a_page_alloc *)sg_dma_address(mem->sgt->sgl); + alloc = (struct gk20a_page_alloc *)(uintptr_t) + sg_dma_address(mem->sgt->sgl); list_for_each_entry(chunk, &alloc->alloc_chunks, list_entry) { if (offset >= chunk->length) offset -= chunk->length; @@ -2191,7 +2192,7 @@ static u64 gk20a_mm_get_align(struct gk20a *g, struct scatterlist *sgl, if (aperture == APERTURE_VIDMEM) { struct gk20a_page_alloc *alloc = (struct gk20a_page_alloc *) - sg_dma_address(sgl); + (uintptr_t)sg_dma_address(sgl); struct page_alloc_chunk *chunk = NULL; list_for_each_entry(chunk, &alloc->alloc_chunks, list_entry) { @@ -2899,7 +2900,7 @@ static int gk20a_gmmu_clear_vidmem_mem(struct gk20a *g, struct mem_desc *mem) if (g->mm.vidmem.ce_ctx_id == ~0) return -EINVAL; - alloc = (struct gk20a_page_alloc *) + alloc = (struct gk20a_page_alloc *)(uintptr_t) sg_dma_address(mem->sgt->sgl); list_for_each_entry(chunk, &alloc->alloc_chunks, list_entry) { @@ -3100,8 +3101,8 @@ u64 gk20a_mem_get_base_addr(struct gk20a *g, struct mem_desc *mem, u64 addr; if (mem->aperture == APERTURE_VIDMEM) { - alloc = (struct gk20a_page_alloc *) - sg_dma_address(mem->sgt->sgl); + alloc = (struct gk20a_page_alloc *)(uintptr_t) + sg_dma_address(mem->sgt->sgl); /* This API should not be used with > 1 chunks */ WARN_ON(alloc->nr_chunks != 1); @@ -3718,7 +3719,7 @@ static int update_gmmu_ptes_locked(struct vm_gk20a *vm, pgsz_idx, gpu_va, gpu_end-1, iova); if (sgt) { - alloc = (struct gk20a_page_alloc *) + alloc = (struct gk20a_page_alloc *)(uintptr_t) sg_dma_address(sgt->sgl); list_for_each_entry(chunk, &alloc->alloc_chunks, -- cgit v1.2.2