From 40bf599da3f821f6e00b2e36f026264098f7c0ca Mon Sep 17 00:00:00 2001 From: Shuicheng Lin Date: Wed, 23 Sep 2026 17:15:27 +0000 Subject: [PATCH] drm/xe: Remove no-op ternary in emit_flush_invalidate() '|' binds tighter than the conditional operator, so the trailing "?: 0" tests the whole OR expression instead of just the TLB flag. MI_FLUSH_DW is non-zero, so the condition is always true and the expression evaluates to itself. Drop the ternary. The mask already yields 0 when MI_INVALIDATE_TLB is not set. No functional change. Cc: Matthew Auld Cc: Matthew Brost Assisted-by: LLM Reviewed-by: Matthew Auld Link: https://patch.msgid.link/20260923171527.663537-1-shuicheng.lin@intel.com Signed-off-by: Shuicheng Lin --- drivers/gpu/drm/xe/xe_ring_ops.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/xe/xe_ring_ops.c b/drivers/gpu/drm/xe/xe_ring_ops.c index 46ab1f0f3564..3dd8cf4e2131 100644 --- a/drivers/gpu/drm/xe/xe_ring_ops.c +++ b/drivers/gpu/drm/xe/xe_ring_ops.c @@ -143,9 +143,8 @@ static int emit_bb_start(u64 batch_addr, u32 ppgtt_flag, u32 *dw, int i) static int emit_flush_invalidate(u32 addr, u32 val, u32 flush_flags, u32 *dw, int i) { - dw[i++] = MI_FLUSH_DW | MI_FLUSH_DW_OP_STOREDW | - MI_FLUSH_IMM_DW | (flush_flags & MI_INVALIDATE_TLB) ?: 0; - + dw[i++] = MI_FLUSH_DW | MI_FLUSH_DW_OP_STOREDW | MI_FLUSH_IMM_DW | + (flush_flags & MI_INVALIDATE_TLB); dw[i++] = addr | MI_FLUSH_DW_USE_GTT; dw[i++] = 0; dw[i++] = val;