* [PATCH][next] drm/display: remove redundant ternary operator
@ 2025-05-06 16:19 Colin Ian King
0 siblings, 0 replies; only message in thread
From: Colin Ian King @ 2025-05-06 16:19 UTC (permalink / raw)
To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
David Airlie, Simona Vetter, dri-devel
Cc: kernel-janitors, linux-kernel
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.
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
drivers/gpu/drm/display/drm_dp_helper.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/display/drm_dp_helper.c b/drivers/gpu/drm/display/drm_dp_helper.c
index 56c7e3318f01..155b4baf6ab5 100644
--- a/drivers/gpu/drm/display/drm_dp_helper.c
+++ b/drivers/gpu/drm/display/drm_dp_helper.c
@@ -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);
--
2.49.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-05-06 16:20 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-05-06 16:19 [PATCH][next] drm/display: remove redundant ternary operator Colin Ian King
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®