]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - include/linux/printk.h
Fix printk_ratelimited()
[bcachefs-tools-debian] / include / linux / printk.h
index bc1619f7cbf765e184d4d80a2cd83a876c4b68e1..df9c1920ddfaf14f47a82a4408a3e589e8bf72ec 100644 (file)
@@ -5,6 +5,7 @@
 #define pr_fmt(fmt) fmt
 #endif
 
+#include <linux/compiler.h>
 #include <stdarg.h>
 #include <stdio.h>
 
@@ -169,7 +170,6 @@ static inline int scnprintf(char * buf, size_t size, const char * fmt, ...)
  * ratelimited messages with local ratelimit_state,
  * no local ratelimit_state used in the !PRINTK case
  */
-#ifdef CONFIG_PRINTK
 #define printk_ratelimited(fmt, ...)                                   \
 ({                                                                     \
        static DEFINE_RATELIMIT_STATE(_rs,                              \
@@ -179,10 +179,6 @@ static inline int scnprintf(char * buf, size_t size, const char * fmt, ...)
        if (__ratelimit(&_rs))                                          \
                printk(fmt, ##__VA_ARGS__);                             \
 })
-#else
-#define printk_ratelimited(fmt, ...)                                   \
-       no_printk(fmt, ##__VA_ARGS__)
-#endif
 
 #define pr_emerg_ratelimited(fmt, ...)                                 \
        printk_ratelimited(KERN_EMERG pr_fmt(fmt), ##__VA_ARGS__)