drm/rockchip: remove redundant assignment to pointer connector
Subsystems (5)
PATCH 1/1 drm/rockchip: remove redundant assignment to pointer connector
The pointer connector is being assigned a value that is never read, it is being re-assigned in the following statement. The assignment is redundant and can be removed.
Cleans up clang scan build warning:drivers/gpu/drm/rockchip/rockchip_rgb.c:153:2: warning: Value stored to 'connector' is never read [deadcode.DeadStores]
--- drivers/gpu/drm/rockchip/rockchip_rgb.c | 1 - 1 file changed, 1 deletion(-)
drivers/gpu/drm/rockchip/rockchip_rgb.c +0 -1
@@ -150,7 +150,6 @@ struct rockchip_rgb *rockchip_rgb_init(struct device *dev,if (ret) goto err_free_encoder; - connector = &rgb->connector; connector =drm_bridge_connector_init (rgb->drm_dev, encoder);if (IS_ERR (connector)) { DRM_DEV_ERROR(drm_dev->dev,
Signature · 1 line
2.35.1
Quoted 8 lines · Colin Ian King
The pointer connector is being assigned a value that is never read, it is being re-assigned in the following statement. The assignment is redundant and can be removed.
Cleans up clang scan build warning:
drivers/gpu/drm/rockchip/rockchip_rgb.c:153:2: warning: Value stored to 'connector' is never read [deadcode.DeadStores]
+ Author & reviewer of:
flag to drm_bridge_attach")
Quoted 22 lines
Signed-off-by Colin Ian King <[email protected]>--- drivers/gpu/drm/rockchip/rockchip_rgb.c | 1 - 1 file changed, 1 deletion(-)drivers/gpu/drm/rockchip/rockchip_rgb.c +0
-2@@ -150,7 +150,6 @@ struct rockchip_rgb *rockchip_rgb_init(struct device *dev,if (ret) goto err_free_encoder; - connector = &rgb->connector; connector =drm_bridge_connector_init (rgb->drm_dev, encoder);if (IS_ERR (connector)) { DRM_DEV_ERROR(drm_dev->dev, --2.35.1
Signature · 2 lines
Thanks, ~Nick Desaulniers
Heiko Stübner
maintainerHi,
looks like I wasn't in the original recipient list, so only got Nick's answer.
Am Mittwoch, 9. März 2022, 00:10:31 CET schrieb Nick Desaulniers:
Quoted 28 lines · Colin Ian King
Quoted 8 lines
The pointer connector is being assigned a value that is never read, it is being re-assigned in the following statement. The assignment is redundant and can be removed.
Cleans up clang scan build warning:
drivers/gpu/drm/rockchip/rockchip_rgb.c:153:2: warning: Value stored to 'connector' is never read [deadcode.DeadStores]+ Author & reviewer of:
Fixes 2e87bf389e13 ("drm/rockchip: add DRM_BRIDGE_ATTACH_NO_CONNECTORflag to
drm_bridge_attach")Quoted 14 lines
Signed-off-by Colin Ian King <[email protected]>--- drivers/gpu/drm/rockchip/rockchip_rgb.c | 1 - 1 file changed, 1 deletion(-)drivers/gpu/drm/rockchip/rockchip_rgb.c +0
-0@@ -150,7 +150,6 @@ struct rockchip_rgb *rockchip_rgb_init(struct device *dev,if (ret) goto err_free_encoder;
Quoted 2 lines
drivers/gpu/drm/rockchip/rockchip_rgb.c struct rockchip_rgb *rockchip_rgb_init(struct device *dev, · line 153
Quoted 2 lines
drivers/gpu/drm/rockchip/rockchip_rgb.c +0
-1- connector = &rgb->connector; connector =drm_bridge_connector_init (rgb->drm_dev, encoder);
I don't think this will work as expected.
Yes, the whole thing looks a bit broken right now, but the connector field in the rockchip_rgb struct still exists and rockchip_rgb_fini also still uses it when calling drm_connector_cleanup.
Same issue seems to exist in in rockchip_lvds.c with drm_connector_cleanup it seems.
I guess drm_bridge_connector_destroy() is responsible for the cleanup so the drm_connector_cleanup call both in rockchip_rgb and rockchip_lvds as well as the local connector elements can go away as well?
Heiko
Quoted 9 lines
Quoted 6 lines
drivers/gpu/drm/rockchip/rockchip_rgb.c +0
-1if (IS_ERR (connector)) { DRM_DEV_ERROR(drm_dev->dev, --2.35.1