From: Noralf Trønnes Date: Tue, 7 Nov 2017 19:13:39 +0000 (+0100) Subject: drm/print: Add drm_printf_indent() X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=bf6234a294c5b8bcc6f47ecdb646f41ad5efddd3;p=openwrt%2Fstaging%2Fblogic.git drm/print: Add drm_printf_indent() Add drm_printf_indent() that adds tab indentation according to argument. Indentation overflow is marked with an X. Reviewed-by: Daniel Vetter Signed-off-by: Noralf Trønnes Reviewed-by: Laurent Pinchart Link: https://patchwork.freedesktop.org/patch/msgid/20171107191348.17555-4-noralf@tronnes.org --- diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h index 7b9c86a6ca3e..7dbfdebec973 100644 --- a/include/drm/drm_print.h +++ b/include/drm/drm_print.h @@ -80,6 +80,14 @@ 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_printf_indent - Print to a &drm_printer stream with indentation + * @printer: DRM printer + * @indent: Tab indentation level (max 5) + * @fmt: Format string + */ +#define drm_printf_indent(printer, indent, fmt, ...) \ + drm_printf((printer), "%.*s" fmt, (indent), "\t\t\t\t\tX", ##__VA_ARGS__) /** * drm_seq_file_printer - construct a &drm_printer that outputs to &seq_file