diff options
author | Amulya <Amurthyreddy@nvidia.com> | 2018-08-28 03:04:55 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-09-19 06:24:12 -0400 |
commit | 941ac9a9d07bedb4062fd0c4d32eb2ef80a42359 (patch) | |
tree | c53622d96a4c2e7c18693ecf4059d7e403cd7808 /drivers/gpu/nvgpu/common/pmu/pmu_perfmon.c | |
parent | 2805f03aa0496502b64ff760f667bfe9d8a27928 (diff) |
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 <Amurthyreddy@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1807132
GVS: Gerrit_Virtual_Submit
Tested-by: Amulya Murthyreddy <amurthyreddy@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common/pmu/pmu_perfmon.c')
-rw-r--r-- | drivers/gpu/nvgpu/common/pmu/pmu_perfmon.c | 10 |
1 files changed, 5 insertions, 5 deletions
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) | |||
51 | default: | 51 | default: |
52 | unit_id = PMU_UNIT_INVALID; | 52 | unit_id = PMU_UNIT_INVALID; |
53 | nvgpu_err(g, "no support for %x", ver); | 53 | nvgpu_err(g, "no support for %x", ver); |
54 | WARN_ON(1); | 54 | WARN_ON(true); |
55 | } | 55 | } |
56 | 56 | ||
57 | return unit_id; | 57 | return unit_id; |
@@ -75,11 +75,11 @@ int nvgpu_pmu_init_perfmon(struct nvgpu_pmu *pmu) | |||
75 | 75 | ||
76 | g->ops.pmu.pmu_init_perfmon_counter(g); | 76 | g->ops.pmu.pmu_init_perfmon_counter(g); |
77 | 77 | ||
78 | if (!pmu->sample_buffer) { | 78 | if (pmu->sample_buffer == 0U) { |
79 | pmu->sample_buffer = nvgpu_alloc(&pmu->dmem, | 79 | pmu->sample_buffer = nvgpu_alloc(&pmu->dmem, |
80 | 2U * sizeof(u16)); | 80 | 2U * sizeof(u16)); |
81 | } | 81 | } |
82 | if (!pmu->sample_buffer) { | 82 | if (pmu->sample_buffer == 0U) { |
83 | nvgpu_err(g, "failed to allocate perfmon sample buffer"); | 83 | nvgpu_err(g, "failed to allocate perfmon sample buffer"); |
84 | return -ENOMEM; | 84 | return -ENOMEM; |
85 | } | 85 | } |
@@ -240,7 +240,7 @@ int nvgpu_pmu_load_update(struct gk20a *g) | |||
240 | void nvgpu_pmu_get_load_counters(struct gk20a *g, u32 *busy_cycles, | 240 | void nvgpu_pmu_get_load_counters(struct gk20a *g, u32 *busy_cycles, |
241 | u32 *total_cycles) | 241 | u32 *total_cycles) |
242 | { | 242 | { |
243 | if (!g->power_on || gk20a_busy(g)) { | 243 | if (!g->power_on || gk20a_busy(g) != 0) { |
244 | *busy_cycles = 0; | 244 | *busy_cycles = 0; |
245 | *total_cycles = 0; | 245 | *total_cycles = 0; |
246 | return; | 246 | return; |
@@ -254,7 +254,7 @@ void nvgpu_pmu_get_load_counters(struct gk20a *g, u32 *busy_cycles, | |||
254 | 254 | ||
255 | void nvgpu_pmu_reset_load_counters(struct gk20a *g) | 255 | void nvgpu_pmu_reset_load_counters(struct gk20a *g) |
256 | { | 256 | { |
257 | if (!g->power_on || gk20a_busy(g)) { | 257 | if (!g->power_on || gk20a_busy(g) != 0) { |
258 | return; | 258 | return; |
259 | } | 259 | } |
260 | 260 | ||