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.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/gpu/nvgpu/common/pmu/pmu.c') diff --git a/drivers/gpu/nvgpu/common/pmu/pmu.c b/drivers/gpu/nvgpu/common/pmu/pmu.c index 0395e463..6d1d5f00 100644 --- a/drivers/gpu/nvgpu/common/pmu/pmu.c +++ b/drivers/gpu/nvgpu/common/pmu/pmu.c @@ -170,8 +170,8 @@ void nvgpu_kill_task_pg_init(struct gk20a *g) break; } nvgpu_udelay(2); - } while (!nvgpu_timeout_expired_msg(&timeout, - "timeout - waiting PMU state machine thread stop")); + } while (nvgpu_timeout_expired_msg(&timeout, + "timeout - waiting PMU state machine thread stop") == 0); } } @@ -214,7 +214,7 @@ static int nvgpu_init_pmu_setup_sw(struct gk20a *g) pmu->mutex_cnt = g->ops.pmu.pmu_mutex_size(); pmu->mutex = nvgpu_kzalloc(g, pmu->mutex_cnt * sizeof(struct pmu_mutex)); - if (!pmu->mutex) { + if (pmu->mutex == NULL) { err = -ENOMEM; goto err; } @@ -226,7 +226,7 @@ static int nvgpu_init_pmu_setup_sw(struct gk20a *g) pmu->seq = nvgpu_kzalloc(g, PMU_MAX_NUM_SEQUENCES * sizeof(struct pmu_sequence)); - if (!pmu->seq) { + if (pmu->seq == NULL) { err = -ENOMEM; goto err_free_mutex; } -- cgit v1.2.2