summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/mm/vm.c
diff options
context:
space:
mode:
authorAlex Waterman <alexw@nvidia.com>2018-09-05 18:28:05 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-09-12 20:48:11 -0400
commit338500c8e2ee342612d7bc4eb1cd87850228d4e2 (patch)
tree55f607de797b24577fb03158c33738322b54e100 /drivers/gpu/nvgpu/common/mm/vm.c
parent19434a22454778a14cd918ad6a0ec061634a1fc2 (diff)
gpu: nvgpu: Fix MISRA 21.2 violations (public allocator APIs)
MISRA 21.2 states that we may not use reserved identifiers; since all identifiers beginning with '_' are reserved by libc, the usage of '__' as a prefix is disallowed. This fixes places in the public allocator APIs. This consists of the various init routines which are used to create an allocator and the debug macro used within the allocator code. The buddy allocator was handled by collapsing the internal '__' prepended version with the non-prefixed version. The only required change was in the page_allocator code which now had to pass in a NULL vm pointer (since the VM is not needed for managing VIDMEM). JIRA NVGPU-1029 Change-Id: I484a144e61789bf594c525c1ca307b96d120830f Signed-off-by: Alex Waterman <alexw@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1813578 Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com> Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common/mm/vm.c')
-rw-r--r--drivers/gpu/nvgpu/common/mm/vm.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/drivers/gpu/nvgpu/common/mm/vm.c b/drivers/gpu/nvgpu/common/mm/vm.c
index 57d9afb5..b2b83767 100644
--- a/drivers/gpu/nvgpu/common/mm/vm.c
+++ b/drivers/gpu/nvgpu/common/mm/vm.c
@@ -420,14 +420,14 @@ int __nvgpu_vm_init(struct mm_gk20a *mm,
420 */ 420 */
421 if (user_vma_start < user_vma_limit) { 421 if (user_vma_start < user_vma_limit) {
422 snprintf(alloc_name, sizeof(alloc_name), "gk20a_%s", name); 422 snprintf(alloc_name, sizeof(alloc_name), "gk20a_%s", name);
423 err = __nvgpu_buddy_allocator_init(g, &vm->user, 423 err = nvgpu_buddy_allocator_init(g, &vm->user,
424 vm, alloc_name, 424 vm, alloc_name,
425 user_vma_start, 425 user_vma_start,
426 user_vma_limit - 426 user_vma_limit -
427 user_vma_start, 427 user_vma_start,
428 SZ_4K, 428 SZ_4K,
429 GPU_BALLOC_MAX_ORDER, 429 GPU_BALLOC_MAX_ORDER,
430 GPU_ALLOC_GVA_SPACE); 430 GPU_ALLOC_GVA_SPACE);
431 if (err) { 431 if (err) {
432 goto clean_up_page_tables; 432 goto clean_up_page_tables;
433 } 433 }
@@ -446,14 +446,14 @@ int __nvgpu_vm_init(struct mm_gk20a *mm,
446 */ 446 */
447 if (user_lp_vma_start < user_lp_vma_limit) { 447 if (user_lp_vma_start < user_lp_vma_limit) {
448 snprintf(alloc_name, sizeof(alloc_name), "gk20a_%s_lp", name); 448 snprintf(alloc_name, sizeof(alloc_name), "gk20a_%s_lp", name);
449 err = __nvgpu_buddy_allocator_init(g, &vm->user_lp, 449 err = nvgpu_buddy_allocator_init(g, &vm->user_lp,
450 vm, alloc_name, 450 vm, alloc_name,
451 user_lp_vma_start, 451 user_lp_vma_start,
452 user_lp_vma_limit - 452 user_lp_vma_limit -
453 user_lp_vma_start, 453 user_lp_vma_start,
454 vm->big_page_size, 454 vm->big_page_size,
455 GPU_BALLOC_MAX_ORDER, 455 GPU_BALLOC_MAX_ORDER,
456 GPU_ALLOC_GVA_SPACE); 456 GPU_ALLOC_GVA_SPACE);
457 if (err) { 457 if (err) {
458 goto clean_up_allocators; 458 goto clean_up_allocators;
459 } 459 }
@@ -463,13 +463,13 @@ int __nvgpu_vm_init(struct mm_gk20a *mm,
463 * Kernel VMA. Must always exist for an address space. 463 * Kernel VMA. Must always exist for an address space.
464 */ 464 */
465 snprintf(alloc_name, sizeof(alloc_name), "gk20a_%s-sys", name); 465 snprintf(alloc_name, sizeof(alloc_name), "gk20a_%s-sys", name);
466 err = __nvgpu_buddy_allocator_init(g, &vm->kernel, 466 err = nvgpu_buddy_allocator_init(g, &vm->kernel,
467 vm, alloc_name, 467 vm, alloc_name,
468 kernel_vma_start, 468 kernel_vma_start,
469 kernel_vma_limit - kernel_vma_start, 469 kernel_vma_limit - kernel_vma_start,
470 SZ_4K, 470 SZ_4K,
471 GPU_BALLOC_MAX_ORDER, 471 GPU_BALLOC_MAX_ORDER,
472 kernel_vma_flags); 472 kernel_vma_flags);
473 if (err) { 473 if (err) {
474 goto clean_up_allocators; 474 goto clean_up_allocators;
475 } 475 }