From: sashiko-bot@kernel.org
To: "Jim Cromie" <jim.cromie@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v2 3/5] drm: fix config dependent unused variable warning.
Date: Fri, 20 Nov 2026 17:33:02 +0000 [thread overview]
Message-ID: <sashiko-outbox-225679@kernel.org> (raw)
In-Reply-To: <20261120-rd-mostly-v2-3-88056ede02a8@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] drm/print: __drm_printfn_dbg() ignores category under
DYNAMIC_DEBUG
--
commit 86a692a9057b290b879237eb899a9b98e98de2c4
Author: Jim Cromie <jim.cromie@gmail.com>
drm: fix config dependent unused variable warning.
This commit removes the local category variable in __drm_printfn_dbg() and
passes p->category directly to __drm_debug_enabled() to avoid an
unused-variable warning when CONFIG_DRM_USE_DYNAMIC_DEBUG=y.
> diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu/drm/drm_print.c
> index 50cdeb1b15e25..12b95901eb707 100644
> --- a/drivers/gpu/drm/drm_print.c
> +++ b/drivers/gpu/drm/drm_print.c
> @@ -218,9 +218,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;
[Severity: Medium]
Should __drm_printfn_dbg() call drm_debug_enabled(p->category) (or
drm_debug_enabled_raw(p->category)) instead of __drm_debug_enabled()?
When CONFIG_DRM_USE_DYNAMIC_DEBUG=y, __drm_debug_enabled() expands to
true without evaluating its argument because it assumes the callsite is
already gated by a dynamic debug descriptor via _dynamic_func_call_cls().
drm_dbg_printer() wires __drm_printfn_dbg() as a function pointer without
a dynamic debug callsite descriptor, so using __drm_debug_enabled() leaves
p->category unchecked and causes all drm_dbg_printer() messages to be
printed unconditionally even when drm.debug has that category disabled.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261120-rd-mostly-v2-0-88056ede02a8@gmail.com?part=3
next prev parent reply other threads:[~2026-11-20 17:33 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-20 17:18 [PATCH v2 0/5] drm/print,dyndbg: __drm_debug __read_mostly, uint shrink, build fixes Jim Cromie
2026-11-20 17:18 ` Jim Cromie via B4 Relay
2026-11-20 17:18 ` [PATCH v2 1/5] drm/print: Mark __drm_debug as __read_mostly Jim Cromie
2026-11-20 17:18 ` Jim Cromie via B4 Relay
2026-11-20 17:18 ` [PATCH v2 2/5] drm: Fix incorrect CFLAGS-y spelling inside Makefile Jim Cromie
2026-11-20 17:18 ` Jim Cromie via B4 Relay
2026-11-20 17:32 ` sashiko-bot
2026-11-20 17:18 ` [PATCH v2 3/5] drm: fix config dependent unused variable warning Jim Cromie
2026-11-20 17:18 ` Jim Cromie via B4 Relay
2026-11-20 17:33 ` sashiko-bot [this message]
2026-11-20 17:18 ` [PATCH v2 4/5] drm/print,dyndbg: restore __drm_debug to uint from ulong Jim Cromie
2026-11-20 17:18 ` Jim Cromie via B4 Relay
2026-11-20 17:18 ` [PATCH v2 5/5] drm-dyndbg: drop BROKEN on DRM_USE_DYNAMIC_DEBUG for testing (DONT_APPLY) Jim Cromie
2026-11-20 17:18 ` Jim Cromie via B4 Relay
2026-11-20 17:35 ` sashiko-bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=sashiko-outbox-225679@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=jim.cromie@gmail.com \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.