gpu: nvgpu: MISRA 14.4 err/ret/status as boolean

MISRA rule 14.4 doesn't allow the usage of integer types as booleans
in the controlling expression of an if statement or an iteration
statement

Fix violations where the integer variables err, ret, status are used
as booleans in the controlling expression of if and loop statements.

JIRA NVGPU-1019

Change-Id: Ia950828797b8eff4bc754269ea2d9fa272f59436
Signed-off-by: Amurthyreddy <amurthyreddy@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1919111
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Scott Long <scottl@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Amurthyreddy
2018-10-04 15:33:16 +05:30
committed by Abdul Salam
parent 8033d33982
commit c114b9e77e
27 changed files with 245 additions and 245 deletions

View File

@@ -437,7 +437,7 @@ static struct nvgpu_page_alloc *nvgpu_alloc_slab(
alloc->sgt.sgl = (struct nvgpu_sgl *)sgl;
err = do_slab_alloc(a, slab, alloc);
if (err) {
if (err != 0) {
goto fail;
}
@@ -1023,7 +1023,7 @@ int nvgpu_page_allocator_init(struct gk20a *g, struct nvgpu_allocator *na,
}
err = nvgpu_alloc_common_init(na, g, name, a, false, &page_ops);
if (err) {
if (err != 0) {
goto fail;
}
@@ -1047,7 +1047,7 @@ int nvgpu_page_allocator_init(struct gk20a *g, struct nvgpu_allocator *na,
if ((flags & GPU_ALLOC_4K_VIDMEM_PAGES) != 0ULL &&
blk_size > SZ_4K) {
err = nvgpu_page_alloc_init_slabs(a);
if (err) {
if (err != 0) {
goto fail;
}
}
@@ -1057,7 +1057,7 @@ int nvgpu_page_allocator_init(struct gk20a *g, struct nvgpu_allocator *na,
err = nvgpu_buddy_allocator_init(g, &a->source_allocator, NULL,
buddy_name, base, length, blk_size,
0ULL, 0ULL);
if (err) {
if (err != 0) {
goto fail;
}