Skip to content

Commit 7aefd8b

Browse files
committed
drm: imx: fix compiler warning with gcc-12
Gcc-12 correctly warned about this code using a non-NULL pointer as a truth value: drivers/gpu/drm/imx/ipuv3-crtc.c: In function ‘ipu_crtc_disable_planes’: drivers/gpu/drm/imx/ipuv3-crtc.c:72:21: error: the comparison will always evaluate as ‘true’ for the address of ‘plane’ will never be NULL [-Werror=address] 72 | if (&ipu_crtc->plane[1] && plane == &ipu_crtc->plane[1]->base) | ^ due to the extraneous '&' address-of operator. Philipp Zabel points out that The mistake had no adverse effect since the following condition doesn't actually dereference the NULL pointer, but the intent of the code was obviously to check for it, not to take the address of the member. Fixes: eb8c888 ("drm/imx: add deferred plane disabling") Acked-by: Philipp Zabel <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 6bfb56e commit 7aefd8b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/imx/ipuv3-crtc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ static void ipu_crtc_disable_planes(struct ipu_crtc *ipu_crtc,
6969
drm_atomic_crtc_state_for_each_plane(plane, old_crtc_state) {
7070
if (plane == &ipu_crtc->plane[0]->base)
7171
disable_full = true;
72-
if (&ipu_crtc->plane[1] && plane == &ipu_crtc->plane[1]->base)
72+
if (ipu_crtc->plane[1] && plane == &ipu_crtc->plane[1]->base)
7373
disable_partial = true;
7474
}
7575

0 commit comments

Comments
 (0)