From: Michal Wajdeczko <michal.wajdeczko@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>,
Pavel E Popov <pavel.e.popov@intel.com>
Subject: [PATCH] drm/xe: Make printk macros more robust
Date: Thu, 9 Oct 2025 23:31:06 +0200 [thread overview]
Message-ID: <20251009213106.6395-1-michal.wajdeczko@intel.com> (raw)
We should make sure that our formatting macro is expanded prior
to invoking final drm_printk macro as we don't control it and
in case of changes in its implementation we may get wrong order
of the parameters.
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Pavel E Popov <pavel.e.popov@intel.com>
---
drivers/gpu/drm/xe/xe_printk.h | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/xe/xe_printk.h b/drivers/gpu/drm/xe/xe_printk.h
index c5be2385aa95..16d851b2118a 100644
--- a/drivers/gpu/drm/xe/xe_printk.h
+++ b/drivers/gpu/drm/xe/xe_printk.h
@@ -12,8 +12,11 @@
#define __XE_PRINTK_FMT(_xe, _fmt, _args...) _fmt, ##_args
+#define __xe_printk(_xe, _level, _fmt, ...) \
+ drm_##_level(&(_xe)->drm, _fmt, ## __VA_ARGS__)
+
#define xe_printk(_xe, _level, _fmt, ...) \
- drm_##_level(&(_xe)->drm, __XE_PRINTK_FMT((_xe), _fmt, ## __VA_ARGS__))
+ __xe_printk((_xe), _level, __XE_PRINTK_FMT((_xe), _fmt, ## __VA_ARGS__))
#define xe_err(_xe, _fmt, ...) \
xe_printk((_xe), err, _fmt, ##__VA_ARGS__)
--
2.47.1
next reply other threads:[~2025-10-09 21:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-09 21:31 Michal Wajdeczko [this message]
2025-10-09 22:29 ` ✓ CI.KUnit: success for drm/xe: Make printk macros more robust Patchwork
2025-10-09 23:15 ` ✓ Xe.CI.BAT: " Patchwork
2025-10-10 7:27 ` ✗ Xe.CI.Full: failure " Patchwork
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=20251009213106.6395-1-michal.wajdeczko@intel.com \
--to=michal.wajdeczko@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=pavel.e.popov@intel.com \
/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