Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/xe: Make printk macros more robust
@ 2025-10-09 21:31 Michal Wajdeczko
  2025-10-09 22:29 ` ✓ CI.KUnit: success for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Michal Wajdeczko @ 2025-10-09 21:31 UTC (permalink / raw)
  To: intel-xe; +Cc: Michal Wajdeczko, Pavel E Popov

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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-10-10  7:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-09 21:31 [PATCH] drm/xe: Make printk macros more robust Michal Wajdeczko
2025-10-09 22:29 ` ✓ CI.KUnit: success for " Patchwork
2025-10-09 23:15 ` ✓ Xe.CI.BAT: " Patchwork
2025-10-10  7:27 ` ✗ Xe.CI.Full: failure " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox