From 978052f9edcf80ef2775c38768b9a370a91e3247 Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Mon, 30 Mar 2026 15:43:02 -0500 Subject: [PATCH] drm: Use weston_log_scope_puts when we don't have a format string We can use __VA_OPT__ to make a macro that automatically selects between the puts and printf log scope variants. Signed-off-by: Derek Foreman --- libweston/backend-drm/drm-internal.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/libweston/backend-drm/drm-internal.h b/libweston/backend-drm/drm-internal.h index b6b385a48..d4ba085d0 100644 --- a/libweston/backend-drm/drm-internal.h +++ b/libweston/backend-drm/drm-internal.h @@ -117,8 +117,15 @@ * system. To avoid confusing side effects, we explicitly cast to the widest * possible type and use a matching format specifier. */ -#define drm_debug(b, ...) \ - weston_log_scope_printf((b)->debug, __VA_ARGS__) +#define DO_DRM_DEBUG_COMPLEX(scope, ...) \ + weston_log_scope_printf(scope, __VA_ARGS__) + +#define DO_DRM_DEBUG(scope, string) \ + weston_log_scope_puts(scope, string) + +#define drm_debug(b, format, ...) \ + DO_DRM_DEBUG ## __VA_OPT__(_COMPLEX) \ + ((b)->debug, format __VA_OPT__(,) __VA_ARGS__) #define MAX_CLONED_CONNECTORS 4