Skip to content

Commit

Permalink
drm/sched: Define pr_fmt() for DRM using pr_*()
Browse files Browse the repository at this point in the history
Define pr_fmt() as "[drm] " for DRM code using pr_*() facilities, especially
when no devices are available. This makes it easier to browse kernel logs.

Signed-off-by: Luben Tuikov <ltuikov89@gmail.com>
Acked-by: Danilo Krummrich <dakr@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231110002659.113208-2-ltuikov89@gmail.com
  • Loading branch information
Luben Tuikov committed Nov 10, 2023
1 parent 4d53cf8 commit 36245bd
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions include/drm/drm_print.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,20 @@
#ifndef DRM_PRINT_H_
#define DRM_PRINT_H_

/* Define this before including linux/printk.h, so that the format
* string in pr_*() macros is correctly set for DRM. If a file wants
* to define this to something else, it should do so before including
* this header file.
*
* It is encouraged code using pr_err() to prefix their format with
* the string "*ERROR* ", to make it easier to scan kernel logs. For
* instance,
* pr_err("*ERROR* <the rest of your format string here>", args).
*/
#ifndef pr_fmt
#define pr_fmt(fmt) "[drm] " fmt
#endif

#include <linux/compiler.h>
#include <linux/printk.h>
#include <linux/seq_file.h>
Expand Down

0 comments on commit 36245bd

Please sign in to comment.