Skip to content

Commit

Permalink
drm/atomic: Avoid unused-but-set-variable warning on for_each_old_pla…
Browse files Browse the repository at this point in the history
…ne_in_state

Artificially use 'plane' and 'old_plane_state' to avoid 'not used' warning.
The precedent has already been set by other macros in the same file.

Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Liu Ying <victor.liu@nxp.com>
  • Loading branch information
Liu Ying authored and intel-lab-lkp committed Oct 17, 2022
1 parent abeaf2e commit 2187a8b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion include/drm/drm_atomic.h
Expand Up @@ -947,7 +947,10 @@ void drm_state_dump(struct drm_device *dev, struct drm_printer *p);
(__i)++) \
for_each_if ((__state)->planes[__i].ptr && \
((plane) = (__state)->planes[__i].ptr, \
(old_plane_state) = (__state)->planes[__i].old_state, 1))
(void)(plane) /* Only to avoid unused-but-set-variable warning */, \
(old_plane_state) = (__state)->planes[__i].old_state, \
(void)(old_plane_state) /* Only to avoid unused-but-set-variable warning */, 1))

/**
* for_each_new_plane_in_state - iterate over all planes in an atomic update
* @__state: &struct drm_atomic_state pointer
Expand Down

0 comments on commit 2187a8b

Please sign in to comment.