From: Lee Jones Date: Mon, 16 Nov 2020 17:41:12 +0000 (+0000) Subject: include/drm/drm_atomic: Make use of 'new_crtc_state' X-Git-Tag: v5.15~303^2~28^2~1352 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=94ffd9b86284ab01464b4546b4a927e419b8be34;p=platform%2Fkernel%2Flinux-starfive.git include/drm/drm_atomic: Make use of 'new_crtc_state' 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 Cc: David Airlie Cc: Daniel Vetter Cc: Shawn Guo Cc: Sascha Hauer Cc: Pengutronix Kernel Team Cc: Fabio Estevam Cc: NXP Linux Team Cc: dri-devel@lists.freedesktop.org Signed-off-by: Lee Jones Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20201116174112.1833368-43-lee.jones@linaro.org --- diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h index dc5e0fb..54e051a 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