From: Luben Tuikov Date: Fri, 10 Nov 2023 00:11:46 +0000 (-0500) Subject: drm/sched: Define pr_fmt() for DRM using pr_*() X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=36245bd02e88e68ac5955c2958c968879d7b75a9;p=users%2Fjedix%2Flinux-maple.git drm/sched: Define pr_fmt() for DRM using pr_*() 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 Acked-by: Danilo Krummrich Link: https://patchwork.freedesktop.org/patch/msgid/20231110002659.113208-2-ltuikov89@gmail.com --- diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h index a93a387f8a1a..e8fe60d0eb87 100644 --- a/include/drm/drm_print.h +++ b/include/drm/drm_print.h @@ -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* ", args). + */ +#ifndef pr_fmt +#define pr_fmt(fmt) "[drm] " fmt +#endif + #include #include #include