From bb1ca4fef5535df9d519c7ef0c5a24b97cf4f4d2 Mon Sep 17 00:00:00 2001 From: Philip Elcan Date: Tue, 7 May 2019 15:30:24 -0400 Subject: [PATCH] gpu: nvgpu: mm: fix MISRA 17.2 violation in nvgpu_allocator MISRA Rule 17.2 prohibits indirect recursion. nvgpu_allocator_initi() was calling nvgpu_page_allocator_init(), which in turn was calling back to nvgpu_allocator_init() to init a buddy allocator. Rather than calling back to nvgpu_allocator_init(), have nvgpu_page_allocator_init() call nvgpu_buddy_allocator_init() directly. JIRA NVGPU-3332 Change-Id: I1102450ae26dda355d5f5dcc3ddb195871c26c32 Signed-off-by: Philip Elcan Reviewed-on: https://git-master.nvidia.com/r/2114028 GVS: Gerrit_Virtual_Submit Reviewed-by: Vinod Gopalakrishnakurup Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/mm/allocators/page_allocator.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/nvgpu/common/mm/allocators/page_allocator.c b/drivers/gpu/nvgpu/common/mm/allocators/page_allocator.c index 1d0033b2e..9d76986dc 100644 --- a/drivers/gpu/nvgpu/common/mm/allocators/page_allocator.c +++ b/drivers/gpu/nvgpu/common/mm/allocators/page_allocator.c @@ -1064,9 +1064,9 @@ int nvgpu_page_allocator_init(struct gk20a *g, struct nvgpu_allocator *na, (void) snprintf(buddy_name, sizeof(buddy_name), "%s-src", name); - err = nvgpu_allocator_init(g, &a->source_allocator, NULL, buddy_name, - base, length, blk_size, 0ULL, 0ULL, - BUDDY_ALLOCATOR); + err = nvgpu_buddy_allocator_init(g, &a->source_allocator, NULL, + buddy_name, base, length, blk_size, + 0ULL, 0ULL); if (err != 0) { goto fail; }