drm: Add a -puts() function for the seq_file printer
authorJordan Crouse <jcrouse@codeaurora.org>
Tue, 24 Jul 2018 16:33:22 +0000 (10:33 -0600)
committerRob Clark <robdclark@gmail.com>
Mon, 30 Jul 2018 12:49:38 +0000 (08:49 -0400)
Add a puts() function to use seq_puts() to help speed up
up print time for constant strings.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
drivers/gpu/drm/drm_print.c
include/drm/drm_print.h

index 01d4e5583b5d9f85c0c572560545005be36bf99d..45d7876117239f96a6da4f9084d3da9315a55632 100644 (file)
@@ -104,6 +104,12 @@ void __drm_printfn_coredump(struct drm_printer *p, struct va_format *vaf)
 }
 EXPORT_SYMBOL(__drm_printfn_coredump);
 
+void __drm_puts_seq_file(struct drm_printer *p, const char *str)
+{
+       seq_puts(p->arg, str);
+}
+EXPORT_SYMBOL(__drm_puts_seq_file);
+
 void __drm_printfn_seq_file(struct drm_printer *p, struct va_format *vaf)
 {
        seq_printf(p->arg, "%pV", vaf);
index f2f42bb87ef25361d10447fe97fdf5605e978399..b1432969b627b08a48acf3700955b1c6a3757f70 100644 (file)
@@ -76,6 +76,7 @@ struct drm_printer {
 
 void __drm_printfn_coredump(struct drm_printer *p, struct va_format *vaf);
 void __drm_printfn_seq_file(struct drm_printer *p, struct va_format *vaf);
+void __drm_puts_seq_file(struct drm_printer *p, const char *str);
 void __drm_printfn_info(struct drm_printer *p, struct va_format *vaf);
 void __drm_printfn_debug(struct drm_printer *p, struct va_format *vaf);
 
@@ -182,6 +183,7 @@ static inline struct drm_printer drm_seq_file_printer(struct seq_file *f)
 {
        struct drm_printer p = {
                .printfn = __drm_printfn_seq_file,
+               .puts = __drm_puts_seq_file,
                .arg = f,
        };
        return p;