diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-05 13:23:25 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-05 13:23:25 -0400 |
commit | e4c393fd551654179c46b65e4a70ea20d831c783 (patch) | |
tree | 087c5c1f514a2ffeb75c925545e584fb269bea3a /include/linux | |
parent | 0a053e8c71d666daf30da2d407147b1293923d8b (diff) | |
parent | 38a6ed3ed8e108b662f4016a1ebf068dcf4c1ef4 (diff) |
Merge branch 'printk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'printk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
printk: correct the behavior of printk_timed_ratelimit()
vsprintf: unify the format decoding layer for its 3 users, cleanup
fix regression from "vsprintf: unify the format decoding layer for its 3 users"
vsprintf: fix bug in negative value printing
vsprintf: unify the format decoding layer for its 3 users
vsprintf: add binary printf
printk: introduce printk_once()
Fix trivial conflicts (printk_once vs log_buf_kexec_setup() added near
each other) in include/linux/kernel.h.
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/kernel.h | 17 | ||||
-rw-r--r-- | include/linux/string.h | 7 |
2 files changed, 24 insertions, 0 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 556d781e69fe..cff58e288a22 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -242,6 +242,19 @@ extern struct ratelimit_state printk_ratelimit_state; | |||
242 | extern int printk_ratelimit(void); | 242 | extern int printk_ratelimit(void); |
243 | extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, | 243 | extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, |
244 | unsigned int interval_msec); | 244 | unsigned int interval_msec); |
245 | |||
246 | /* | ||
247 | * Print a one-time message (analogous to WARN_ONCE() et al): | ||
248 | */ | ||
249 | #define printk_once(x...) ({ \ | ||
250 | static int __print_once = 1; \ | ||
251 | \ | ||
252 | if (__print_once) { \ | ||
253 | __print_once = 0; \ | ||
254 | printk(x); \ | ||
255 | } \ | ||
256 | }) | ||
257 | |||
245 | void log_buf_kexec_setup(void); | 258 | void log_buf_kexec_setup(void); |
246 | #else | 259 | #else |
247 | static inline int vprintk(const char *s, va_list args) | 260 | static inline int vprintk(const char *s, va_list args) |
@@ -254,6 +267,10 @@ static inline int printk_ratelimit(void) { return 0; } | |||
254 | static inline bool printk_timed_ratelimit(unsigned long *caller_jiffies, \ | 267 | static inline bool printk_timed_ratelimit(unsigned long *caller_jiffies, \ |
255 | unsigned int interval_msec) \ | 268 | unsigned int interval_msec) \ |
256 | { return false; } | 269 | { return false; } |
270 | |||
271 | /* No effect, but we still get type checking even in the !PRINTK case: */ | ||
272 | #define printk_once(x...) printk(x) | ||
273 | |||
257 | static inline void log_buf_kexec_setup(void) | 274 | static inline void log_buf_kexec_setup(void) |
258 | { | 275 | { |
259 | } | 276 | } |
diff --git a/include/linux/string.h b/include/linux/string.h index 8852739f36df..3c877d686375 100644 --- a/include/linux/string.h +++ b/include/linux/string.h | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <linux/compiler.h> /* for inline */ | 10 | #include <linux/compiler.h> /* for inline */ |
11 | #include <linux/types.h> /* for size_t */ | 11 | #include <linux/types.h> /* for size_t */ |
12 | #include <linux/stddef.h> /* for NULL */ | 12 | #include <linux/stddef.h> /* for NULL */ |
13 | #include <stdarg.h> | ||
13 | 14 | ||
14 | extern char *strndup_user(const char __user *, long); | 15 | extern char *strndup_user(const char __user *, long); |
15 | extern void *memdup_user(const void __user *, size_t); | 16 | extern void *memdup_user(const void __user *, size_t); |
@@ -112,6 +113,12 @@ extern void argv_free(char **argv); | |||
112 | 113 | ||
113 | extern bool sysfs_streq(const char *s1, const char *s2); | 114 | extern bool sysfs_streq(const char *s1, const char *s2); |
114 | 115 | ||
116 | #ifdef CONFIG_BINARY_PRINTF | ||
117 | int vbin_printf(u32 *bin_buf, size_t size, const char *fmt, va_list args); | ||
118 | int bstr_printf(char *buf, size_t size, const char *fmt, const u32 *bin_buf); | ||
119 | int bprintf(u32 *bin_buf, size_t size, const char *fmt, ...) __printf(3, 4); | ||
120 | #endif | ||
121 | |||
115 | extern ssize_t memory_read_from_buffer(void *to, size_t count, loff_t *ppos, | 122 | extern ssize_t memory_read_from_buffer(void *to, size_t count, loff_t *ppos, |
116 | const void *from, size_t available); | 123 | const void *from, size_t available); |
117 | 124 | ||