Skip to contentSkip to conversation

drm/display: remove redundant ternary operator

PATCH New Colin Ian King 1 participant 1 message May 6, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/display: remove redundant ternary operator

The ternary operator is checking if ret is less than zero inside an if block that also checks if ret is less than zero. Since the nested ternary statement is always true then the -EIO return is never executed and can be removed.

---
 drivers/gpu/drm/display/drm_dp_helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/display/drm_dp_helper.c +1 -1
index 56c7e3318f01..155b4baf6ab5 100644
@@ -4192,7 +4192,7 @@ drm_edp_backlight_probe_state(struct drm_dp_aux *aux, struct drm_edp_backlight_i
 	if (ret < 0) {
 		drm_dbg_kms(aux->drm_dev, "%s: Failed to read backlight mode: %d\n",
 			    aux->name, ret);
-		return ret < 0 ? ret : -EIO;
+		return ret;
 	}
 
 	*current_mode = (mode_reg & DP_EDP_BACKLIGHT_CONTROL_MODE_MASK);
Signature · 1 line
2.49.0