gpu: nvgpu: Fix LibC MISRA 17.7 in common

MISRA Rule-17.7 requires the return value of all functions to be used.
Fix is either to use the return value or change the function to return
void. This patch contains fix for all 17.7 violations instandard C functions
in common code.

JIRA NVGPU-1036

Change-Id: Id6dea92df371e71b22b54cd7a521fc22812f9b69
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1929899
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Nicolas Benech
2018-10-18 10:50:29 -04:00
committed by mobile promotions
parent 27b47c20bd
commit cb2a05dd92
20 changed files with 97 additions and 88 deletions

View File

@@ -294,7 +294,7 @@ static struct page_alloc_slab_page *alloc_slab_page(
return NULL;
}
memset(slab_page, 0, sizeof(*slab_page));
(void) memset(slab_page, 0, sizeof(*slab_page));
slab_page->page_addr = nvgpu_alloc(&a->source_allocator, a->page_size);
if (slab_page->page_addr == 0ULL) {
@@ -535,7 +535,7 @@ static struct nvgpu_page_alloc *do_nvgpu_alloc_pages(
goto fail;
}
memset(alloc, 0, sizeof(*alloc));
(void) memset(alloc, 0, sizeof(*alloc));
alloc->length = pages << a->page_shift;
alloc->sgt.ops = &page_alloc_sgl_ops;
@@ -1060,7 +1060,7 @@ int nvgpu_page_allocator_init(struct gk20a *g, struct nvgpu_allocator *na,
}
}
snprintf(buddy_name, sizeof(buddy_name), "%s-src", name);
(void) snprintf(buddy_name, sizeof(buddy_name), "%s-src", name);
err = nvgpu_buddy_allocator_init(g, &a->source_allocator, NULL,
buddy_name, base, length, blk_size,