From 941ac9a9d07bedb4062fd0c4d32eb2ef80a42359 Mon Sep 17 00:00:00 2001 From: Amulya Date: Tue, 28 Aug 2018 12:34:55 +0530 Subject: nvgpu: common: MISRA 10.1 boolean fixes Fix violations where a variable of type non-boolean is used as a boolean in gpu/nvgpu/common. JIRA NVGPU-646 Change-Id: I9773d863b715f83ae1772b75d5373f77244bc8ca Signed-off-by: Amulya Reviewed-on: https://git-master.nvidia.com/r/1807132 GVS: Gerrit_Virtual_Submit Tested-by: Amulya Murthyreddy Reviewed-by: Vijayakumar Subbu Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/pmu/pmu_perfmon.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'drivers/gpu/nvgpu/common/pmu/pmu_perfmon.c') diff --git a/drivers/gpu/nvgpu/common/pmu/pmu_perfmon.c b/drivers/gpu/nvgpu/common/pmu/pmu_perfmon.c index a99e86ce..12ab4422 100644 --- a/drivers/gpu/nvgpu/common/pmu/pmu_perfmon.c +++ b/drivers/gpu/nvgpu/common/pmu/pmu_perfmon.c @@ -51,7 +51,7 @@ static u8 get_perfmon_id(struct nvgpu_pmu *pmu) default: unit_id = PMU_UNIT_INVALID; nvgpu_err(g, "no support for %x", ver); - WARN_ON(1); + WARN_ON(true); } return unit_id; @@ -75,11 +75,11 @@ int nvgpu_pmu_init_perfmon(struct nvgpu_pmu *pmu) g->ops.pmu.pmu_init_perfmon_counter(g); - if (!pmu->sample_buffer) { + if (pmu->sample_buffer == 0U) { pmu->sample_buffer = nvgpu_alloc(&pmu->dmem, 2U * sizeof(u16)); } - if (!pmu->sample_buffer) { + if (pmu->sample_buffer == 0U) { nvgpu_err(g, "failed to allocate perfmon sample buffer"); return -ENOMEM; } @@ -240,7 +240,7 @@ int nvgpu_pmu_load_update(struct gk20a *g) void nvgpu_pmu_get_load_counters(struct gk20a *g, u32 *busy_cycles, u32 *total_cycles) { - if (!g->power_on || gk20a_busy(g)) { + if (!g->power_on || gk20a_busy(g) != 0) { *busy_cycles = 0; *total_cycles = 0; return; @@ -254,7 +254,7 @@ void nvgpu_pmu_get_load_counters(struct gk20a *g, u32 *busy_cycles, void nvgpu_pmu_reset_load_counters(struct gk20a *g) { - if (!g->power_on || gk20a_busy(g)) { + if (!g->power_on || gk20a_busy(g) != 0) { return; } -- cgit v1.2.2