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 <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2114028
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vinod Gopalakrishnakurup <vinodg@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Philip Elcan
2019-05-07 15:30:24 -04:00
committed by mobile promotions
parent bceac52f0b
commit bb1ca4fef5

View File

@@ -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;
}