[PATCH] drm: bridge: cdns-mhdp8546: drop redundant NULL check
From: Жамбакиев Радий Рикардинович
Date: Thu Aug 20 2026 - 04:02:22 EST
to_cdns_mhdp_bridge_state() is a container_of() on the first member
of struct cdns_mhdp_bridge_state, so it cannot return NULL as long
as its input is non-NULL. The bridge state is already NULL-checked
right before the conversion, making the check on the converted
pointer dead code.
Remove it.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Signed-off-by: Radiy Zhambakiev <r.zhambakiev@xxxxxxxxxxxxxxxxx>
---
drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
index 36c07b71fe04..424183db6f76 100644
--- a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
+++ b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
@@ -2145,11 +2145,6 @@ static int cdns_mhdp_update_link_status(struct
cdns_mhdp_device *mhdp)
}
cdns_bridge_state = to_cdns_mhdp_bridge_state(state);
- if (!cdns_bridge_state) {
- ret = -EINVAL;
- goto out;
- }
-
current_mode = cdns_bridge_state->current_mode;
if (!current_mode) {
ret = -EINVAL;
--
2.53.0