[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <04b28c61-6930-48aa-8775-471311e57486@bootlin.com>
Date: Mon, 24 Mar 2025 16:23:29 +0100
From: Louis Chauvet <louis.chauvet@...tlin.com>
To: Jim Cromie <jim.cromie@...il.com>, linux-kernel@...r.kernel.org,
dri-devel@...ts.freedesktop.org, amd-gfx@...ts.freedesktop.org,
intel-gvt-dev@...ts.freedesktop.org, intel-gfx@...ts.freedesktop.org,
intel-gfx-trybot@...ts.freedesktop.org
Cc: jbaron@...mai.com, gregkh@...uxfoundation.org, ukaszb@...omium.org,
daniel.vetter@...ll.ch, tvrtko.ursulin@...ux.intel.com,
jani.nikula@...el.com, ville.syrjala@...ux.intel.com
Subject: Re: [PATCH v2 38/59] drm-print: fix config-dependent unused variable
Le 20/03/2025 à 19:52, Jim Cromie a écrit :
> With CONFIG_DRM_USE_DYNAMIC_DEBUG=y, __drm_printfn_dbg() gets an
> unused variable warning/error on 'category', even though the usage
> follows immediately, in drm_debug_enabled(category).
>
> For static-key optimized dyndbg, the macro doesn't actually check the
> category var, since the static-key patches in the proper state. The
> compiler evidently sees this lack of reference and complains.
>
> So this drops the local var and refs the field directly in the
> macro-call, which avoids the warning/error.
>
> Signed-off-by: Jim Cromie <jim.cromie@...il.com>
Reviewed-by: Louis Chauvet <louis.chauvet@...tlin.com>
I believe I can merge it before the entire series. Does anyone have any
objections?
> ---
> drivers/gpu/drm/drm_print.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu/drm/drm_print.c
> index 46d53fe30204..41ad11247b48 100644
> --- a/drivers/gpu/drm/drm_print.c
> +++ b/drivers/gpu/drm/drm_print.c
> @@ -212,9 +212,8 @@ void __drm_printfn_dbg(struct drm_printer *p, struct va_format *vaf)
> {
> const struct drm_device *drm = p->arg;
> const struct device *dev = drm ? drm->dev : NULL;
> - enum drm_debug_category category = p->category;
>
> - if (!__drm_debug_enabled(category))
> + if (!__drm_debug_enabled(p->category))
> return;
>
> __drm_dev_vprintk(dev, KERN_DEBUG, p->origin, p->prefix, vaf);
--
Louis Chauvet, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
Powered by blists - more mailing lists