]> Git Repo - linux.git/commitdiff
drm/sched: Define pr_fmt() for DRM using pr_*()
authorLuben Tuikov <[email protected]>
Fri, 10 Nov 2023 00:11:46 +0000 (19:11 -0500)
committerLuben Tuikov <[email protected]>
Fri, 10 Nov 2023 01:18:21 +0000 (20:18 -0500)
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 <[email protected]>
Acked-by: Danilo Krummrich <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
include/drm/drm_print.h

index a93a387f8a1a15b17fe2826e4b09017189394e02..e8fe60d0eb87838687b7de3b640d8fff9228c12a 100644 (file)
 #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>
This page took 0.054114 seconds and 4 git commands to generate.