Re: [PATCH v4 03/11] drm/print: Add drm_printf_indent()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Noralf,

Thank you for the patch.

On Monday, 30 October 2017 18:29:37 EET Noralf Trønnes wrote:
> Add drm_printf_indent() that adds tab indentation according to argument.
> Indentation overflow is marked with an X.

I wonder if this kind of thing would be useful to add to printk somehow. 
That's not a blocker though, we can switch to a more generic implementation 
later when one will be available.

> Reviewed-by: Daniel Vetter <daniel.vetter@xxxxxxxx>
> Signed-off-by: Noralf Trønnes <noralf@xxxxxxxxxxx>

Reviewed-by: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>

> ---
> 
> Changes since version 3:
> - Turn drm_printf_indent() into a macro (Ville)
> - drm_printf_indent() add overflow marker (Jani)
> 
>  include/drm/drm_print.h | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> 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


-- 
Regards,

Laurent Pinchart

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux