gpu: nvgpu: MISRA 10.1 boolean fixes

MISRA rule 10.1 doesn't allow the usage of non-boolean variables as
booleans. Fix violations where a variable of type non-boolean is used
as a boolean.

JIRA NVGPU-646

Change-Id: If451037ada9a5f41b0cddb50778de57f60864f5c
Signed-off-by: Amurthyreddy <amurthyreddy@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1815742
GVS: Gerrit_Virtual_Submit
Reviewed-by: Adeel Raza <araza@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-11-13 10:09:42 +05:30
committed by mobile promotions
parent 359a8b82d9
commit b68e465fab
21 changed files with 55 additions and 52 deletions

View File

@@ -244,7 +244,7 @@ int nvgpu_lwpr_mclk_change(struct gk20a *g, u32 pstate)
pstate_info = pstate_get_clk_set_info(g, pstate,
clkwhich_mclk);
if (!pstate_info) {
if (pstate_info == NULL) {
return -EINVAL;
}
@@ -325,7 +325,7 @@ bool nvgpu_lpwr_is_mscg_supported(struct gk20a *g, u32 pstate_num)
nvgpu_log_fn(g, " ");
if (!pstate) {
if (pstate == NULL) {
return false;
}
@@ -348,7 +348,7 @@ bool nvgpu_lpwr_is_rppg_supported(struct gk20a *g, u32 pstate_num)
nvgpu_log_fn(g, " ");
if (!pstate) {
if (pstate == NULL) {
return false;
}
@@ -381,7 +381,7 @@ int nvgpu_lpwr_enable_pg(struct gk20a *g, bool pstate_lock)
is_mscg_supported = nvgpu_lpwr_is_mscg_supported(g,
present_pstate);
if (is_mscg_supported && g->mscg_enabled) {
if (!pmu->mscg_stat) {
if (pmu->mscg_stat == 0U) {
pmu->mscg_stat = PMU_MSCG_ENABLED;
}
}