[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250902192636.GR13448@pendragon.ideasonboard.com>
Date: Tue, 2 Sep 2025 21:26:36 +0200
From: Laurent Pinchart <laurent.pinchart@...asonboard.com>
To: Maxime Ripard <mripard@...nel.org>
Cc: Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Thomas Zimmermann <tzimmermann@...e.de>,
David Airlie <airlied@...il.com>, Simona Vetter <simona@...ll.ch>,
Andrzej Hajda <andrzej.hajda@...el.com>,
Neil Armstrong <neil.armstrong@...aro.org>,
Robert Foss <rfoss@...nel.org>, Jonas Karlman <jonas@...boo.se>,
Jernej Skrabec <jernej.skrabec@...il.com>,
Jyri Sarha <jyri.sarha@....fi>,
Tomi Valkeinen <tomi.valkeinen@...asonboard.com>,
Devarsh Thakkar <devarsht@...com>, dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 03/29] drm/atomic: Fix unused but set warning in
for_each_old_private_obj_in_state
Hi Maxime,
Thank you for the patch.
On Tue, Sep 02, 2025 at 10:32:31AM +0200, Maxime Ripard wrote:
> The for_each_old_private_obj_in_state() macro triggers a compiler
> warning if the obj parameter passed to it isn't used in the code block.
>
> Add a similar workaround than in most other macros.
>
I'd squash this with the previous patch, and also address the other
similar macros.
> Signed-off-by: Maxime Ripard <mripard@...nel.org>
> ---
> include/drm/drm_atomic.h | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h
> index 689a29bdeb4a06672ab6fffecb513d58ff6e07f9..f13f926d21047e42bb9ac692c2dd4b88f2ebd91c 100644
> --- a/include/drm/drm_atomic.h
> +++ b/include/drm/drm_atomic.h
> @@ -1112,10 +1112,11 @@ void drm_state_dump(struct drm_device *dev, struct drm_printer *p);
> */
> #define for_each_old_private_obj_in_state(__state, obj, old_obj_state, __i) \
> for ((__i) = 0; \
> (__i) < (__state)->num_private_objs && \
> ((obj) = (__state)->private_objs[__i].ptr, \
> + (void)(obj) /* Only to avoid unused-but-set-variable warning */, \
> (old_obj_state) = (__state)->private_objs[__i].old_state, 1); \
> (__i)++)
>
> /**
> * for_each_new_private_obj_in_state - iterate over all private objects in an atomic update
--
Regards,
Laurent Pinchart
Powered by blists - more mailing lists