Hi Maxime, Thank you for the patch.
On Tue, Sep 02, 2025 at 10:32:30AM +0200, Maxime Ripard wrote: > The for_each_old_plane_in_state() macro triggers a compiler warning if > the plane parameter passed to it isn't used in the code block. > > Add a similar workaround than in most other macros. > > Signed-off-by: Maxime Ripard <mrip...@kernel.org> > --- > include/drm/drm_atomic.h | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h > index > 38636a593c9d98cadda85ccd67326cb152f0dd27..689a29bdeb4a06672ab6fffecb513d58ff6e07f9 > 100644 > --- a/include/drm/drm_atomic.h > +++ b/include/drm/drm_atomic.h > @@ -1053,11 +1053,13 @@ void drm_state_dump(struct drm_device *dev, struct > drm_printer *p); > for ((__i) = 0; \ > (__i) < (__state)->dev->mode_config.num_total_plane; \ > (__i)++) \ > for_each_if ((__state)->planes[__i].ptr && \ > ((plane) = (__state)->planes[__i].ptr, \ > + (void)(plane) /* Only to avoid > unused-but-set-variable warning */, \ > (old_plane_state) = > (__state)->planes[__i].old_state, 1)) > + While at it, shouldn't you apply the same workaround to the old_plane_state variable, like done for new_plane_state in for_each_new_plane_in_state() ? Or is it expected that drivers will always make use of it. Reviewed-by: Laurent Pinchart <laurent.pinchart+rene...@ideasonboard.com> > /** > * for_each_new_plane_in_state - iterate over all planes in an atomic update > * @__state: &struct drm_atomic_state pointer > * @plane: &struct drm_plane iteration cursor > * @new_plane_state: &struct drm_plane_state iteration cursor for the new > state -- Regards, Laurent Pinchart