summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/mm/gmmu.c
diff options
context:
space:
mode:
authorAmulya <Amurthyreddy@nvidia.com>2018-08-09 01:10:08 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-08-22 20:31:33 -0400
commit1c13da1d29c344cb60953eabeca56b601446c64a (patch)
tree145a1a133b2d85592e0ddd1a25b12fc48e879829 /drivers/gpu/nvgpu/common/mm/gmmu.c
parentf3c3e4dece89c5e2f77fbfaf3cacd877ba62406c (diff)
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 <Amurthyreddy@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1795593 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common/mm/gmmu.c')
-rw-r--r--drivers/gpu/nvgpu/common/mm/gmmu.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/gpu/nvgpu/common/mm/gmmu.c b/drivers/gpu/nvgpu/common/mm/gmmu.c
index 73a37b57..02273393 100644
--- a/drivers/gpu/nvgpu/common/mm/gmmu.c
+++ b/drivers/gpu/nvgpu/common/mm/gmmu.c
@@ -109,7 +109,7 @@ static u64 __nvgpu_gmmu_map(struct vm_gk20a *vm,
109 sgt, /* sg list */ 109 sgt, /* sg list */
110 0, /* sg offset */ 110 0, /* sg offset */
111 size, 111 size,
112 gmmu_page_size_kernel, 112 GMMU_PAGE_SIZE_KERNEL,
113 0, /* kind */ 113 0, /* kind */
114 0, /* ctag_offset */ 114 0, /* ctag_offset */
115 flags, rw_flag, 115 flags, rw_flag,
@@ -169,7 +169,7 @@ void nvgpu_gmmu_unmap(struct vm_gk20a *vm, struct nvgpu_mem *mem, u64 gpu_va)
169 g->ops.mm.gmmu_unmap(vm, 169 g->ops.mm.gmmu_unmap(vm,
170 gpu_va, 170 gpu_va,
171 mem->size, 171 mem->size,
172 gmmu_page_size_kernel, 172 GMMU_PAGE_SIZE_KERNEL,
173 mem->free_gpu_va, 173 mem->free_gpu_va,
174 gk20a_mem_flag_none, 174 gk20a_mem_flag_none,
175 false, 175 false,
@@ -609,8 +609,8 @@ static int __nvgpu_gmmu_update_page_table(struct vm_gk20a *vm,
609 609
610 /* note: here we need to map kernel to small, since the 610 /* note: here we need to map kernel to small, since the
611 * low-level mmu code assumes 0 is small and 1 is big pages */ 611 * low-level mmu code assumes 0 is small and 1 is big pages */
612 if (attrs->pgsz == gmmu_page_size_kernel) { 612 if (attrs->pgsz == GMMU_PAGE_SIZE_KERNEL) {
613 attrs->pgsz = gmmu_page_size_small; 613 attrs->pgsz = GMMU_PAGE_SIZE_SMALL;
614 } 614 }
615 615
616 page_size = vm->gmmu_page_sizes[attrs->pgsz]; 616 page_size = vm->gmmu_page_sizes[attrs->pgsz];
@@ -676,7 +676,7 @@ u64 gk20a_locked_gmmu_map(struct vm_gk20a *vm,
676 struct nvgpu_sgt *sgt, 676 struct nvgpu_sgt *sgt,
677 u64 buffer_offset, 677 u64 buffer_offset,
678 u64 size, 678 u64 size,
679 int pgsz_idx, 679 u32 pgsz_idx,
680 u8 kind_v, 680 u8 kind_v,
681 u32 ctag_offset, 681 u32 ctag_offset,
682 u32 flags, 682 u32 flags,
@@ -764,7 +764,7 @@ fail_alloc:
764void gk20a_locked_gmmu_unmap(struct vm_gk20a *vm, 764void gk20a_locked_gmmu_unmap(struct vm_gk20a *vm,
765 u64 vaddr, 765 u64 vaddr,
766 u64 size, 766 u64 size,
767 int pgsz_idx, 767 u32 pgsz_idx,
768 bool va_allocated, 768 bool va_allocated,
769 enum gk20a_mem_rw_flag rw_flag, 769 enum gk20a_mem_rw_flag rw_flag,
770 bool sparse, 770 bool sparse,
@@ -865,7 +865,7 @@ static int __nvgpu_locate_pte(struct gk20a *g, struct vm_gk20a *vm,
865 865
866 attrs->pgsz = l->get_pgsz(g, l, pd, pd_idx); 866 attrs->pgsz = l->get_pgsz(g, l, pd, pd_idx);
867 867
868 if (attrs->pgsz >= gmmu_nr_page_sizes) { 868 if (attrs->pgsz >= GMMU_NR_PAGE_SIZES) {
869 return -EINVAL; 869 return -EINVAL;
870 } 870 }
871 871