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: I8c9ad786a741b78293d0ebc4e1c33d4d0fc8f9b4
Signed-off-by: Amurthyreddy <amurthyreddy@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1921260
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@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-08 10:54:08 +05:30
committed by mobile promotions
parent 745e720089
commit c94643155e
27 changed files with 203 additions and 203 deletions

View File

@@ -191,19 +191,19 @@ static int get_lpwr_ms_table(struct gk20a *g)
return 0;
}
u32 nvgpu_lpwr_pg_setup(struct gk20a *g)
int nvgpu_lpwr_pg_setup(struct gk20a *g)
{
u32 err = 0;
int err = 0;
nvgpu_log_fn(g, " ");
err = get_lpwr_gr_table(g);
if (err) {
if (err != 0) {
return err;
}
err = get_lpwr_ms_table(g);
if (err) {
if (err != 0) {
return err;
}
@@ -220,7 +220,7 @@ static void nvgpu_pmu_handle_param_lpwr_msg(struct gk20a *g,
nvgpu_log_fn(g, " ");
if (status != 0) {
if (status != 0U) {
nvgpu_err(g, "LWPR PARAM cmd aborted");
return;
}
@@ -423,7 +423,7 @@ int nvgpu_lpwr_disable_pg(struct gk20a *g, bool pstate_lock)
if (is_rppg_supported) {
if (g->support_pmu && g->elpg_enabled) {
status = nvgpu_pmu_disable_elpg(g);
if (status) {
if (status != 0) {
goto exit_unlock;
}
}