drm/msm/a6xx: Remove logically deadcode in a6xx_preempt.c
authorEverest K.C. <everestkc@everestkc.com.np>
Fri, 11 Oct 2024 05:23:14 +0000 (23:23 -0600)
committerRob Clark <robdclark@chromium.org>
Sun, 27 Oct 2024 15:13:19 +0000 (08:13 -0700)
The ternary operator never returns -1 as `ring` will never be NULL.
Thus, the ternary operator is not needed.
Fix this by removing the ternary operation and only including the
value it will return when the `ring` is not NULL.

This was reported by Coverity Scan.
https://scan7.scan.coverity.com/#/project-view/51525/11354?selectedIssue=1600286

Fixes: 35d36dc1692f ("drm/msm/a6xx: Add traces for preemption")
Signed-off-by: Everest K.C. <everestkc@everestkc.com.np>
Patchwork: https://patchwork.freedesktop.org/patch/619349/
Signed-off-by: Rob Clark <robdclark@chromium.org>
drivers/gpu/drm/msm/adreno/a6xx_preempt.c

index 6803d5a..2fd4e39 100644 (file)
@@ -297,8 +297,7 @@ void a6xx_preempt_trigger(struct msm_gpu *gpu)
         */
        ring->restore_wptr = false;
 
-       trace_msm_gpu_preemption_trigger(a6xx_gpu->cur_ring->id,
-               ring ? ring->id : -1);
+       trace_msm_gpu_preemption_trigger(a6xx_gpu->cur_ring->id, ring->id);
 
        spin_unlock_irqrestore(&ring->preempt_lock, flags);