Skip to content

Commit

Permalink
drm: Add a -puts() function for the seq_file printer
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jordan Crouse authored and Rob Clark committed Jul 30, 2018
1 parent 63f4cc0 commit 4538d73
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/gpu/drm/drm_print.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions include/drm/drm_print.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 4538d73

Please sign in to comment.