The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Jim Cromie via B4 Relay <devnull+jim.cromie.gmail.com@kernel.org>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	 Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	 David Airlie <airlied@gmail.com>,
	Simona Vetter <simona@ffwll.ch>,  Jason Baron <jbaron@akamai.com>,
	 Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	 Andrew Morton <akpm@linux-foundation.org>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	 Jim Cromie <jim.cromie@gmail.com>
Subject: [PATCH v2 3/5] drm: fix config dependent unused variable warning.
Date: Fri, 20 Nov 2026 10:18:30 -0700	[thread overview]
Message-ID: <20261120-rd-mostly-v2-3-88056ede02a8@gmail.com> (raw)
In-Reply-To: <20261120-rd-mostly-v2-0-88056ede02a8@gmail.com>

From: Jim Cromie <jim.cromie@gmail.com>

__drm_printfn_dbg() does:
      enum drm_debug_category category = p->category;
then:
      if (!__drm_debug_enabled(category))

When CONFIG_DRM_USE_DYNAMIC_DEBUG=y, __drm_debug_enabled(category)
expands to `true` without referencing `category`, causing an
unused-variable warning/error. Silence it by passing p->category
directly.

Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
---
 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 50cdeb1b15e2..12b95901eb70 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;
 
 	__drm_dev_vprintk(dev, KERN_DEBUG, p->origin, p->prefix, vaf);

-- 
2.56.1



  parent reply	other threads:[~2026-11-20 17:19 UTC|newest]

Thread overview: 6+ 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 via B4 Relay
2026-11-20 17:18 ` [PATCH v2 1/5] drm/print: Mark __drm_debug as __read_mostly Jim Cromie via B4 Relay
2026-11-20 17:18 ` [PATCH v2 2/5] drm: Fix incorrect CFLAGS-y spelling inside Makefile Jim Cromie via B4 Relay
2026-11-20 17:18 ` Jim Cromie via B4 Relay [this message]
2026-11-20 17:18 ` [PATCH v2 4/5] drm/print,dyndbg: restore __drm_debug to uint from ulong 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 via B4 Relay

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=20261120-rd-mostly-v2-3-88056ede02a8@gmail.com \
    --to=devnull+jim.cromie.gmail.com@kernel.org \
    --cc=airlied@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jbaron@akamai.com \
    --cc=jim.cromie@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=tzimmermann@suse.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox