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

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2016-2018, NVIDIA CORPORATION. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -25,12 +25,12 @@
#include "thrm.h"
#include "thrmpmu.h"
u32 therm_domain_sw_setup(struct gk20a *g)
int therm_domain_sw_setup(struct gk20a *g)
{
u32 status;
int status;
status = therm_device_sw_setup(g);
if (status) {
if (status != 0) {
nvgpu_err(g,
"error creating boardobjgrp for therm devices, status - 0x%x",
status);
@@ -38,7 +38,7 @@ u32 therm_domain_sw_setup(struct gk20a *g)
}
status = therm_channel_sw_setup(g);
if (status) {
if (status != 0) {
nvgpu_err(g,
"error creating boardobjgrp for therm channel, status - 0x%x",
status);