linux-stable/drivers/gpu
Linus Torvalds f2a9ecd71f drm: imx: fix compiler warning with gcc-12
[ Upstream commit 7aefd8b538 ]

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: eb8c88808c ("drm/imx: add deferred plane disabling")
Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-06-14 18:41:32 +02:00
..
drm drm: imx: fix compiler warning with gcc-12 2022-06-14 18:41:32 +02:00
host1x gpu: host1x: Fix a memory leak in 'host1x_remove()' 2022-04-08 13:58:14 +02:00
ipu-v3 gpu: ipu-v3: Fix dev_dbg frequency output 2022-04-20 09:36:21 +02:00
trace
vga
Makefile