]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/print: clean up RATELIMITED macros
authorSam Ravnborg <sam@ravnborg.org>
Fri, 14 Feb 2020 17:54:42 +0000 (18:54 +0100)
committerSam Ravnborg <sam@ravnborg.org>
Sat, 15 Feb 2020 13:39:35 +0000 (14:39 +0100)
Drop a few indirections, making the code simpler.
This also drops a RATELIMITED variant that is not in use.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200214175919.GA14492@ravnborg.org
include/drm/drm_print.h

index fd6ba2532f50dfc6ab7c3c274fa6ba64a3233e32..ca7cee8e728a5e7c94c8809c7b0bafc4ecb7959c 100644 (file)
@@ -383,25 +383,6 @@ void drm_dev_dbg(const struct device *dev, enum drm_debug_category category,
 #define DRM_DEV_DEBUG_KMS(dev, fmt, ...)                               \
        drm_dev_dbg(dev, DRM_UT_KMS, fmt, ##__VA_ARGS__)
 
-#define _DRM_DEV_DEFINE_DEBUG_RATELIMITED(dev, category, fmt, ...)     \
-({                                                                     \
-       static DEFINE_RATELIMIT_STATE(_rs,                              \
-                                     DEFAULT_RATELIMIT_INTERVAL,       \
-                                     DEFAULT_RATELIMIT_BURST);         \
-       if (__ratelimit(&_rs))                                          \
-               drm_dev_dbg(dev, category, fmt, ##__VA_ARGS__);         \
-})
-
-/**
- * Rate limited debug output. Like DRM_DEBUG() but won't flood the log.
- *
- * @dev: device pointer
- * @fmt: printf() like format string.
- */
-#define DRM_DEV_DEBUG_KMS_RATELIMITED(dev, fmt, ...)                   \
-       _DRM_DEV_DEFINE_DEBUG_RATELIMITED(dev, DRM_UT_KMS,              \
-                                         fmt, ##__VA_ARGS__)
-
 /*
  * struct drm_device based logging
  *
@@ -525,7 +506,13 @@ void __drm_err(const char *format, ...);
 
 
 #define DRM_DEBUG_KMS_RATELIMITED(fmt, ...)                            \
-       DRM_DEV_DEBUG_KMS_RATELIMITED(NULL, fmt, ##__VA_ARGS__)
+({                                                                     \
+       static DEFINE_RATELIMIT_STATE(_rs,                              \
+                                     DEFAULT_RATELIMIT_INTERVAL,       \
+                                     DEFAULT_RATELIMIT_BURST);         \
+       if (__ratelimit(&_rs))                                          \
+               drm_dev_dbg(NULL, DRM_UT_KMS, fmt, ##__VA_ARGS__);      \
+})
 
 /*
  * struct drm_device based WARNs