From e2b155e9924c39c074339cf77e22a0a4cead66e0 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 23 Nov 2017 08:40:46 +0000 Subject: drm/printer: Add drm_vprintf() Simple va_args equivalent to the existing drm_printf() for use with the drm_printer. v2: Fixup kerneldoc to match final parameter names. v3: Turn it into a kerneldoc comment Signed-off-by: Chris Wilson Cc: Rob Clark Reviewed-by: Daniel Vetter Cc: Dave Airlie Acked-by: Dave Airlie Signed-off-by: Joonas Lahtinen Link: https://patchwork.freedesktop.org/patch/msgid/20171123084051.30203-1-chris@chris-wilson.co.uk --- include/drm/drm_print.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'include/drm') diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h index 0968e411f562..5f9932e2246e 100644 --- a/include/drm/drm_print.h +++ b/include/drm/drm_print.h @@ -80,6 +80,21 @@ void __drm_printfn_debug(struct drm_printer *p, struct va_format *vaf); __printf(2, 3) void drm_printf(struct drm_printer *p, const char *f, ...); +/** + * drm_vprintf - print to a &drm_printer stream + * @p: the &drm_printer + * @fmt: format string + * @va: the va_list + */ +__printf(2, 0) +static inline void +drm_vprintf(struct drm_printer *p, const char *fmt, va_list *va) +{ + struct va_format vaf = { .fmt = fmt, .va = va }; + + p->printfn(p, &vaf); +} + /** * drm_printf_indent - Print to a &drm_printer stream with indentation * @printer: DRM printer -- cgit v1.2.3