From 1c13da1d29c344cb60953eabeca56b601446c64a Mon Sep 17 00:00:00 2001 From: Amulya Date: Thu, 9 Aug 2018 10:40:08 +0530 Subject: gpu: nvgpu: Changed enum gmmu_pgsz_gk20a into macros Changed the enum gmmu_pgsz_gk20a into macros and changed all the instances of it. The enum gmmu_pgsz_gk20a was being used in for loops, where it was compared with an integer. This violates MISRA rule 10.4, which only allows arithmetic operations on operands of the same essential type category. Changing this enum into macro will fix this violation. JIRA NVGPU-993 Change-Id: I6f18b08bc7548093d99e8229378415bcdec749e3 Signed-off-by: Amulya Reviewed-on: https://git-master.nvidia.com/r/1795593 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/vgpu/gv11b/vgpu_fifo_gv11b.c | 10 +++++----- drivers/gpu/nvgpu/vgpu/gv11b/vgpu_subctx_gv11b.c | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'drivers/gpu/nvgpu/vgpu/gv11b') diff --git a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_fifo_gv11b.c b/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_fifo_gv11b.c index e718a30d..43cff1c0 100644 --- a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_fifo_gv11b.c +++ b/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_fifo_gv11b.c @@ -43,7 +43,7 @@ static int set_syncpt_ro_map_gpu_va_locked(struct vm_gk20a *vm) vm->syncpt_ro_map_gpu_va = __nvgpu_vm_alloc_va(vm, g->syncpt_unit_size, - gmmu_page_size_kernel); + GMMU_PAGE_SIZE_KERNEL); if (!vm->syncpt_ro_map_gpu_va) { nvgpu_err(g, "allocating read-only va space failed"); return -ENOMEM; @@ -63,7 +63,7 @@ static int set_syncpt_ro_map_gpu_va_locked(struct vm_gk20a *vm) "mapping read-only va space failed err %d", err); __nvgpu_vm_free_va(vm, vm->syncpt_ro_map_gpu_va, - gmmu_page_size_kernel); + GMMU_PAGE_SIZE_KERNEL); vm->syncpt_ro_map_gpu_va = 0; return err; } @@ -91,7 +91,7 @@ int vgpu_gv11b_fifo_alloc_syncpt_buf(struct channel_gk20a *c, return err; syncpt_buf->gpu_va = __nvgpu_vm_alloc_va(c->vm, g->syncpt_size, - gmmu_page_size_kernel); + GMMU_PAGE_SIZE_KERNEL); if (!syncpt_buf->gpu_va) { nvgpu_err(g, "allocating syncpt va space failed"); return -ENOMEM; @@ -110,7 +110,7 @@ int vgpu_gv11b_fifo_alloc_syncpt_buf(struct channel_gk20a *c, if (err) { nvgpu_err(g, "mapping syncpt va space failed err %d", err); __nvgpu_vm_free_va(c->vm, syncpt_buf->gpu_va, - gmmu_page_size_kernel); + GMMU_PAGE_SIZE_KERNEL); return err; } @@ -121,7 +121,7 @@ void vgpu_gv11b_fifo_free_syncpt_buf(struct channel_gk20a *c, struct nvgpu_mem *syncpt_buf) { nvgpu_gmmu_unmap(c->vm, syncpt_buf, syncpt_buf->gpu_va); - __nvgpu_vm_free_va(c->vm, syncpt_buf->gpu_va, gmmu_page_size_kernel); + __nvgpu_vm_free_va(c->vm, syncpt_buf->gpu_va, GMMU_PAGE_SIZE_KERNEL); nvgpu_dma_free(c->g, syncpt_buf); } diff --git a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_subctx_gv11b.c b/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_subctx_gv11b.c index 2372b9c4..b536d15e 100644 --- a/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_subctx_gv11b.c +++ b/drivers/gpu/nvgpu/vgpu/gv11b/vgpu_subctx_gv11b.c @@ -40,7 +40,7 @@ int vgpu_gv11b_alloc_subctx_header(struct channel_gk20a *c) p->ch_handle = c->virt_ctx; p->ctx_header_va = __nvgpu_vm_alloc_va(c->vm, ctxsw_prog_fecs_header_v(), - gmmu_page_size_kernel); + GMMU_PAGE_SIZE_KERNEL); if (!p->ctx_header_va) { nvgpu_err(c->g, "alloc va failed for ctx_header"); return -ENOMEM; @@ -50,7 +50,7 @@ int vgpu_gv11b_alloc_subctx_header(struct channel_gk20a *c) if (unlikely(err)) { nvgpu_err(c->g, "alloc ctx_header failed err %d", err); __nvgpu_vm_free_va(c->vm, p->ctx_header_va, - gmmu_page_size_kernel); + GMMU_PAGE_SIZE_KERNEL); return err; } ctx->mem.gpu_va = p->ctx_header_va; @@ -75,7 +75,7 @@ void vgpu_gv11b_free_subctx_header(struct channel_gk20a *c) if (unlikely(err)) nvgpu_err(c->g, "free ctx_header failed err %d", err); __nvgpu_vm_free_va(c->vm, ctx->mem.gpu_va, - gmmu_page_size_kernel); + GMMU_PAGE_SIZE_KERNEL); ctx->mem.gpu_va = 0; } } -- cgit v1.2.2