From 83f873c95dbc29eef6b948d3d40b0186c5b71e79 Mon Sep 17 00:00:00 2001 From: Vinod G Date: Wed, 1 May 2019 17:23:03 -0700 Subject: [PATCH] gpu: nvgpu: MISRA fixes in gr_intr file Fix one violation for MISRA Rule-13.5 - Expression after || has persistent side effect Fix two violation for MISRA Rule-17.7 - Return value is unused Jira NVGPU-3227 Change-Id: I29127914ffcf2b075c4ac515b3a998f98c779556 Signed-off-by: Vinod G Reviewed-on: https://git-master.nvidia.com/r/2109778 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/gr/gr_intr.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/nvgpu/common/gr/gr_intr.c b/drivers/gpu/nvgpu/common/gr/gr_intr.c index 2d30c0c18..beba7c59d 100644 --- a/drivers/gpu/nvgpu/common/gr/gr_intr.c +++ b/drivers/gpu/nvgpu/common/gr/gr_intr.c @@ -635,8 +635,13 @@ void nvgpu_gr_intr_handle_notify_pending(struct gk20a *g, struct nvgpu_gr_isr_data *isr_data) { struct channel_gk20a *ch = isr_data->ch; + int err; - if (ch == NULL || tsg_gk20a_from_ch(ch) == NULL) { + if (ch == NULL) { + return; + } + + if (tsg_gk20a_from_ch(ch) == NULL) { return; } @@ -646,7 +651,10 @@ void nvgpu_gr_intr_handle_notify_pending(struct gk20a *g, nvgpu_cyclestats_exec(g, ch, isr_data->data_lo); #endif - nvgpu_cond_broadcast_interruptible(&ch->notifier_wq); + err = nvgpu_cond_broadcast_interruptible(&ch->notifier_wq); + if (err != 0) { + nvgpu_log(g, gpu_dbg_intr, "failed to broadcast"); + } } void nvgpu_gr_intr_handle_semaphore_pending(struct gk20a *g, @@ -661,10 +669,15 @@ void nvgpu_gr_intr_handle_semaphore_pending(struct gk20a *g, tsg = tsg_gk20a_from_ch(ch); if (tsg != NULL) { + int err; + g->ops.tsg.post_event_id(tsg, NVGPU_EVENT_ID_GR_SEMAPHORE_WRITE_AWAKEN); - nvgpu_cond_broadcast(&ch->semaphore_wq); + err = nvgpu_cond_broadcast(&ch->semaphore_wq); + if (err != 0) { + nvgpu_log(g, gpu_dbg_intr, "failed to broadcast"); + } } else { nvgpu_err(g, "chid: %d is not bound to tsg", ch->chid); }