[Intel-gfx] [PATCH v6] drm: two more (drm_)printk() wrapper macros (fixup)

Dave Gordon david.s.gordon at intel.com
Wed Sep 7 17:36:18 UTC 2016


Between v2 and v3 of this patch,
  c4e68a583202 ("drm: Introduce DRM_DEV_* log messages")
was introduced upstream, and this was the reason for the rewrite as v3.
Unfortunately a maintainer pushed the earlier version to drm-intel-next
  30b0da8d556e ("drm: extra printk() wrapper macros")
creating a conflict with upstream. This patch is equivalent to reverting
v2 and then correctly applying v3. AFAICT, it could be squashed into
  30b0da8d556e ("drm: extra printk() wrapper macros")
or can be left as a subsequent correction.

Original commentary:
  We had only DRM_INFO() and DRM_ERROR(), whereas the underlying printk()
  provides several other useful intermediate levels such as NOTICE and
  WARNING. So this patch fills out the set by providing simple macros for
  the additional levels. We don't provide _DEV_ or _ONCE or RATELIMITED
  versions yet as it seems unlikely that they'll be as useful.

v2:
    Fix whitespace, missing ## (Eric Engestrom)
v3:
    Much simplified after underlying functions were reworked.
v6:
    Fixup, effectively revert v2 and apply v3

Signed-off-by: Dave Gordon <david.s.gordon at intel.com>
Reviewed-by: Eric Engestrom <eric.engestrom at imgtec.com> (v2, v3)
Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk> (v3)
Cc: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
---
 include/drm/drmP.h | 19 ++++---------------
 1 file changed, 4 insertions(+), 15 deletions(-)

diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index f62f6e3..cd52624 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -168,21 +168,12 @@ void drm_printk(const char *level, unsigned int category,
 /** \name Macros to make printk easier */
 /*@{*/
 
-#define _DRM_PRINTK(once, level, fmt, ...)				\
-	do {								\
-		printk##once(KERN_##level "[" DRM_NAME "] " fmt,	\
-			     ##__VA_ARGS__);				\
-	} while (0)
-
+#define DRM_INFO(fmt, ...)						\
+	drm_printk(KERN_INFO, DRM_UT_NONE, __func__, "", fmt, ##__VA_ARGS__)
 #define DRM_NOTE(fmt, ...)						\
-	_DRM_PRINTK(, NOTICE, fmt, ##__VA_ARGS__)
+	drm_printk(KERN_NOTICE, DRM_UT_NONE, __func__, "", fmt, ##__VA_ARGS__)
 #define DRM_WARN(fmt, ...)						\
-	_DRM_PRINTK(, WARNING, fmt, ##__VA_ARGS__)
-
-#define DRM_NOTE_ONCE(fmt, ...)						\
-	_DRM_PRINTK(_once, NOTICE, fmt, ##__VA_ARGS__)
-#define DRM_WARN_ONCE(fmt, ...)						\
-	_DRM_PRINTK(_once, WARNING, fmt, ##__VA_ARGS__)
+	drm_printk(KERN_WARNING, DRM_UT_NONE, __func__, "", fmt, ##__VA_ARGS__)
 
 /**
  * Error output.
@@ -218,8 +209,6 @@ void drm_printk(const char *level, unsigned int category,
 #define DRM_DEV_INFO(dev, fmt, ...)					\
 	drm_dev_printk(dev, KERN_INFO, DRM_UT_NONE, __func__, "", fmt,	\
 		       ##__VA_ARGS__)
-#define DRM_INFO(fmt, ...)						\
-	drm_printk(KERN_INFO, DRM_UT_NONE, __func__, "", fmt, ##__VA_ARGS__)
 
 #define DRM_DEV_INFO_ONCE(dev, fmt, ...)				\
 ({									\
-- 
1.9.1



More information about the Intel-gfx mailing list