From: Luca Ceresoli Date: Tue, 7 Apr 2026 12:24:18 +0000 (+0200) Subject: drm/mxsfb/lcdif: move iteration-specific variables declaration inside loop in lcdif_a... X-Git-Tag: v7.2-rc1~141^2~26^2~94 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=a6bdf27448b49af6a9daa1d081e2f019fb002a4a;p=thirdparty%2Flinux.git drm/mxsfb/lcdif: move iteration-specific variables declaration inside loop in lcdif_attach_bridge The bridge and ret variables are per-iteration variables, whose values don't have to be carried to the next iteration or be used after the loop end. Move their declaration inside the loop scope as a cleanup and to make code clearer. Reviewed-by: Liu Ying Link: https://patch.msgid.link/20260407-drm-lcdif-dbanc-v4-4-247a16e61ef9@bootlin.com Signed-off-by: Luca Ceresoli --- diff --git a/drivers/gpu/drm/mxsfb/lcdif_drv.c b/drivers/gpu/drm/mxsfb/lcdif_drv.c index 1c76709c4d94d..c8ba8f9b1da8b 100644 --- a/drivers/gpu/drm/mxsfb/lcdif_drv.c +++ b/drivers/gpu/drm/mxsfb/lcdif_drv.c @@ -50,14 +50,14 @@ static int lcdif_attach_bridge(struct lcdif_drm_private *lcdif) { struct device *dev = lcdif->drm->dev; struct device_node *ep __free(device_node) = NULL; - struct drm_bridge *bridge; - int ret; for_each_endpoint_of_node(dev->of_node, ep) { struct device_node *remote __free(device_node) = of_graph_get_remote_port_parent(ep); struct of_endpoint of_ep; + struct drm_bridge *bridge; struct drm_encoder *encoder; + int ret; if (!of_device_is_available(remote)) continue;