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: I9e18ffc961d485225732c34d3ca561e84d182d07
Signed-off-by: Amurthyreddy <amurthyreddy@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1921370
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Amurthyreddy
2018-10-08 13:30:54 +05:30
committed by mobile promotions
parent 30aeb71693
commit a39c48e3e2
22 changed files with 156 additions and 156 deletions

View File

@@ -28,7 +28,7 @@
#include "ctrl/ctrlboardobj.h"
int boardobjgrpconstruct_e32(struct gk20a *g,
int boardobjgrpconstruct_e32(struct gk20a *g,
struct boardobjgrp_e32 *pboardobjgrp_e32)
{
int status;
@@ -38,7 +38,7 @@ int boardobjgrpconstruct_e32(struct gk20a *g,
objslots = 32;
status = boardobjgrpmask_e32_init(&pboardobjgrp_e32->mask, NULL);
if (status) {
if (status != 0) {
goto boardobjgrpconstruct_e32_exit;
}
@@ -48,7 +48,7 @@ int boardobjgrpconstruct_e32(struct gk20a *g,
pboardobjgrp_e32->super.mask = &(pboardobjgrp_e32->mask.super);
status = boardobjgrp_construct_super(g, &pboardobjgrp_e32->super);
if (status) {
if (status != 0) {
goto boardobjgrpconstruct_e32_exit;
}
@@ -79,7 +79,7 @@ int boardobjgrp_pmuhdrdatainit_e32(struct gk20a *g,
status = boardobjgrpmask_export(mask,
mask->bitcount,
&pgrpe32->obj_mask.super);
if (status) {
if (status != 0) {
nvgpu_err(g, "e32 init:failed export grpmask");
return status;
}