From 7ef3d2fd17c377ef64a2aa19677d17576606c3b4 Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Fri, 8 Feb 2008 04:21:25 -0800 Subject: printk_ratelimit() functions should use CONFIG_PRINTK Makes an embedded image a bit smaller. Signed-off-by: Joe Perches Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/kernel.h | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 7d7519628dfa..8f28d35867f8 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -180,6 +180,13 @@ asmlinkage int printk(const char * fmt, ...) extern int log_buf_get_len(void); extern int log_buf_read(int idx); extern int log_buf_copy(char *dest, int idx, int len); + +extern int printk_ratelimit_jiffies; +extern int printk_ratelimit_burst; +extern int printk_ratelimit(void); +extern int __printk_ratelimit(int ratelimit_jiffies, int ratelimit_burst); +extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, + unsigned int interval_msec); #else static inline int vprintk(const char *s, va_list args) __attribute__ ((format (printf, 1, 0))); @@ -190,6 +197,12 @@ static inline int __cold printk(const char *s, ...) { return 0; } static inline int log_buf_get_len(void) { return 0; } static inline int log_buf_read(int idx) { return 0; } static inline int log_buf_copy(char *dest, int idx, int len) { return 0; } +static inline int printk_ratelimit(void) { return 0; } +static inline int __printk_ratelimit(int ratelimit_jiffies, \ + int ratelimit_burst) { return 0; } +static inline bool printk_timed_ratelimit(unsigned long *caller_jiffies, \ + unsigned int interval_msec) \ + { return false; } #endif extern void __attribute__((format(printf, 1, 2))) @@ -197,11 +210,6 @@ extern void __attribute__((format(printf, 1, 2))) unsigned long int_sqrt(unsigned long); -extern int printk_ratelimit(void); -extern int __printk_ratelimit(int ratelimit_jiffies, int ratelimit_burst); -extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, - unsigned int interval_msec); - static inline void console_silent(void) { console_loglevel = 0; -- cgit v1.2.3