In the macro for_each_oldnew_crtc_in_state() 'crtc_state' is provided
as a container for state->crtcs[i].new_state, but is not utilised in
some use-cases, so we fake-use it instead.

Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/imx/ipuv3-plane.c: In function ‘ipu_planes_assign_pre’:
 drivers/gpu/drm/imx/ipuv3-plane.c:746:42: warning: variable ‘crtc_state’ set 
but not used [-Wunused-but-set-variable]

Cc: Philipp Zabel <p.za...@pengutronix.de>
Cc: David Airlie <airl...@linux.ie>
Cc: Daniel Vetter <dan...@ffwll.ch>
Cc: Shawn Guo <shawn...@kernel.org>
Cc: Sascha Hauer <s.ha...@pengutronix.de>
Cc: Pengutronix Kernel Team <ker...@pengutronix.de>
Cc: Fabio Estevam <feste...@gmail.com>
Cc: NXP Linux Team <linux-...@nxp.com>
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Lee Jones <lee.jo...@linaro.org>
---
 include/drm/drm_atomic.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h
index dc5e0fbecc04e..54e051a957dfc 100644
--- a/include/drm/drm_atomic.h
+++ b/include/drm/drm_atomic.h
@@ -783,7 +783,8 @@ void drm_state_dump(struct drm_device *dev, struct 
drm_printer *p);
                              (void)(crtc) /* Only to avoid 
unused-but-set-variable warning */, \
                             (old_crtc_state) = 
(__state)->crtcs[__i].old_state, \
                             (void)(old_crtc_state) /* Only to avoid 
unused-but-set-variable warning */, \
-                            (new_crtc_state) = 
(__state)->crtcs[__i].new_state, 1))
+                            (new_crtc_state) = 
(__state)->crtcs[__i].new_state, \
+                            (void)(new_crtc_state) /* Only to avoid 
unused-but-set-variable warning */, 1))
 
 /**
  * for_each_old_crtc_in_state - iterate over all CRTCs in an atomic update
-- 
2.25.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Reply via email to