gpu: nvgpu: Fix MISRA 13.5 in hal ltc driver

Fixed 13.5 misra violation by moving nvgpu_timeout_expired_msg_impl
outside of while and added error value check.

JIRA NVGPU-3422

Change-Id: I49df330d005efd64be3b4914c0338dd41bfb5b70
Signed-off-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2119971
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vinod Gopalakrishnakurup <vinodg@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Seshendra Gadagottu
2019-05-15 14:36:32 -07:00
committed by mobile promotions
parent 51a86f81bb
commit 71ec37ac46

View File

@@ -121,9 +121,11 @@ void gm20b_flush_ltc(struct gk20a *g)
op_pending = gk20a_readl(g, cmgmt1);
is_clean_pending_set = (op_pending &
ltc_ltc0_ltss_tstg_cmgmt1_clean_pending_f()) != 0U;
} while (is_clean_pending_set &&
(nvgpu_timeout_expired_msg(&timeout,
"L2 flush timeout!") == 0));
if (nvgpu_timeout_expired_msg(&timeout,
"L2 flush timeout!") != 0) {
err = -ETIMEDOUT;
}
} while (is_clean_pending_set && (err == 0));
}
/* And invalidate. */
@@ -151,9 +153,11 @@ void gm20b_flush_ltc(struct gk20a *g)
op_pending = gk20a_readl(g, cmgmt0);
is_invalidate_pending_set = (op_pending &
ltc_ltc0_ltss_tstg_cmgmt0_invalidate_pending_f()) != 0U;
} while (is_invalidate_pending_set &&
(nvgpu_timeout_expired_msg(&timeout,
"L2 flush timeout!") == 0));
if (nvgpu_timeout_expired_msg(&timeout,
"L2 flush timeout!") != 0) {
err = -ETIMEDOUT;
}
} while (is_invalidate_pending_set && (err == 0));
}
}