mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-25 02:52:51 +03:00
gpu: nvgpu: MISRA 14.4 err/ret/status as boolean
MISRA rule 14.4 doesn't allow the usage of integer types as booleans in the controlling expression of an if statement or an iteration statement Fix violations where the integer variables err, ret, status are used as booleans in the controlling expression of if and loop statements. JIRA NVGPU-1019 Change-Id: Ia950828797b8eff4bc754269ea2d9fa272f59436 Signed-off-by: Amurthyreddy <amurthyreddy@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1919111 Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com> Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: Scott Long <scottl@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
Abdul Salam
parent
8033d33982
commit
c114b9e77e
@@ -73,7 +73,7 @@ static bool gr_context_info_available(struct gr_gk20a *gr)
|
||||
nvgpu_mutex_acquire(&gr->ctx_mutex);
|
||||
err = !gr->ctx_vars.golden_image_initialized;
|
||||
nvgpu_mutex_release(&gr->ctx_mutex);
|
||||
if (err) {
|
||||
if (err != 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -222,7 +222,7 @@ int exec_regops_gk20a(struct dbg_session_gk20a *dbg_s,
|
||||
err = gr_gk20a_exec_ctx_ops(ch, ops, num_ops,
|
||||
ctx_wr_count, ctx_rd_count,
|
||||
is_current_ctx);
|
||||
if (err) {
|
||||
if (err != 0) {
|
||||
nvgpu_warn(g, "failed to perform ctx ops\n");
|
||||
goto clean_up;
|
||||
}
|
||||
@@ -377,7 +377,7 @@ static int validate_reg_op_offset(struct dbg_session_gk20a *dbg_s,
|
||||
&num_offsets,
|
||||
op->type == REGOP(TYPE_GR_CTX_QUAD),
|
||||
op->quad);
|
||||
if (err) {
|
||||
if (err != 0) {
|
||||
err = gr_gk20a_get_pm_ctx_buffer_offsets(dbg_s->g,
|
||||
op->offset,
|
||||
1,
|
||||
@@ -385,7 +385,7 @@ static int validate_reg_op_offset(struct dbg_session_gk20a *dbg_s,
|
||||
&buf_offset_addr,
|
||||
&num_offsets);
|
||||
|
||||
if (err) {
|
||||
if (err != 0) {
|
||||
op->status |= REGOP(STATUS_INVALID_OFFSET);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user