diff options
author | Joe Perches <joe@perches.com> | 2008-02-08 07:21:25 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-08 12:22:39 -0500 |
commit | 7ef3d2fd17c377ef64a2aa19677d17576606c3b4 (patch) | |
tree | 036c2fe4a87bda412908bc82602ce29f4d431dbe /include/linux/kernel.h | |
parent | 36e789144267105e0b3f2b9bca7db3184fce50dc (diff) |
printk_ratelimit() functions should use CONFIG_PRINTK
Makes an embedded image a bit smaller.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/kernel.h')
-rw-r--r-- | include/linux/kernel.h | 18 |
1 files changed, 13 insertions, 5 deletions
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, ...) | |||
180 | extern int log_buf_get_len(void); | 180 | extern int log_buf_get_len(void); |
181 | extern int log_buf_read(int idx); | 181 | extern int log_buf_read(int idx); |
182 | extern int log_buf_copy(char *dest, int idx, int len); | 182 | extern int log_buf_copy(char *dest, int idx, int len); |
183 | |||
184 | extern int printk_ratelimit_jiffies; | ||
185 | extern int printk_ratelimit_burst; | ||
186 | extern int printk_ratelimit(void); | ||
187 | extern int __printk_ratelimit(int ratelimit_jiffies, int ratelimit_burst); | ||
188 | extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, | ||
189 | unsigned int interval_msec); | ||
183 | #else | 190 | #else |
184 | static inline int vprintk(const char *s, va_list args) | 191 | static inline int vprintk(const char *s, va_list args) |
185 | __attribute__ ((format (printf, 1, 0))); | 192 | __attribute__ ((format (printf, 1, 0))); |
@@ -190,6 +197,12 @@ static inline int __cold printk(const char *s, ...) { return 0; } | |||
190 | static inline int log_buf_get_len(void) { return 0; } | 197 | static inline int log_buf_get_len(void) { return 0; } |
191 | static inline int log_buf_read(int idx) { return 0; } | 198 | static inline int log_buf_read(int idx) { return 0; } |
192 | static inline int log_buf_copy(char *dest, int idx, int len) { return 0; } | 199 | static inline int log_buf_copy(char *dest, int idx, int len) { return 0; } |
200 | static inline int printk_ratelimit(void) { return 0; } | ||
201 | static inline int __printk_ratelimit(int ratelimit_jiffies, \ | ||
202 | int ratelimit_burst) { return 0; } | ||
203 | static inline bool printk_timed_ratelimit(unsigned long *caller_jiffies, \ | ||
204 | unsigned int interval_msec) \ | ||
205 | { return false; } | ||
193 | #endif | 206 | #endif |
194 | 207 | ||
195 | extern void __attribute__((format(printf, 1, 2))) | 208 | extern void __attribute__((format(printf, 1, 2))) |
@@ -197,11 +210,6 @@ extern void __attribute__((format(printf, 1, 2))) | |||
197 | 210 | ||
198 | unsigned long int_sqrt(unsigned long); | 211 | unsigned long int_sqrt(unsigned long); |
199 | 212 | ||
200 | extern int printk_ratelimit(void); | ||
201 | extern int __printk_ratelimit(int ratelimit_jiffies, int ratelimit_burst); | ||
202 | extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, | ||
203 | unsigned int interval_msec); | ||
204 | |||
205 | static inline void console_silent(void) | 213 | static inline void console_silent(void) |
206 | { | 214 | { |
207 | console_loglevel = 0; | 215 | console_loglevel = 0; |