diff options
author | Joe Perches <joe@perches.com> | 2011-10-31 20:11:33 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-10-31 20:30:54 -0400 |
commit | b9075fa968a0a4347aef35e235e2995c0e57dddd (patch) | |
tree | cf9f9716784e790d8a43339653256d9cf9178ff3 /include/linux/printk.h | |
parent | ae29bc92da01a2e9d278a9a58c3b307d41cc0254 (diff) |
treewide: use __printf not __attribute__((format(printf,...)))
Standardize the style for compiler based printf format verification.
Standardized the location of __printf too.
Done via script and a little typing.
$ grep -rPl --include=*.[ch] -w "__attribute__" * | \
grep -vP "^(tools|scripts|include/linux/compiler-gcc.h)" | \
xargs perl -n -i -e 'local $/; while (<>) { s/\b__attribute__\s*\(\s*\(\s*format\s*\(\s*printf\s*,\s*(.+)\s*,\s*(.+)\s*\)\s*\)\s*\)/__printf($1, $2)/g ; print; }'
[akpm@linux-foundation.org: revert arch bits]
Signed-off-by: Joe Perches <joe@perches.com>
Cc: "Kirill A. Shutemov" <kirill@shutemov.name>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/printk.h')
-rw-r--r-- | include/linux/printk.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/include/linux/printk.h b/include/linux/printk.h index 0101d55d9651..f0e22f75143f 100644 --- a/include/linux/printk.h +++ b/include/linux/printk.h | |||
@@ -82,22 +82,22 @@ struct va_format { | |||
82 | * Dummy printk for disabled debugging statements to use whilst maintaining | 82 | * Dummy printk for disabled debugging statements to use whilst maintaining |
83 | * gcc's format and side-effect checking. | 83 | * gcc's format and side-effect checking. |
84 | */ | 84 | */ |
85 | static inline __attribute__ ((format (printf, 1, 2))) | 85 | static inline __printf(1, 2) |
86 | int no_printk(const char *fmt, ...) | 86 | int no_printk(const char *fmt, ...) |
87 | { | 87 | { |
88 | return 0; | 88 | return 0; |
89 | } | 89 | } |
90 | 90 | ||
91 | extern asmlinkage __attribute__ ((format (printf, 1, 2))) | 91 | extern asmlinkage __printf(1, 2) |
92 | void early_printk(const char *fmt, ...); | 92 | void early_printk(const char *fmt, ...); |
93 | 93 | ||
94 | extern int printk_needs_cpu(int cpu); | 94 | extern int printk_needs_cpu(int cpu); |
95 | extern void printk_tick(void); | 95 | extern void printk_tick(void); |
96 | 96 | ||
97 | #ifdef CONFIG_PRINTK | 97 | #ifdef CONFIG_PRINTK |
98 | asmlinkage __attribute__ ((format (printf, 1, 0))) | 98 | asmlinkage __printf(1, 0) |
99 | int vprintk(const char *fmt, va_list args); | 99 | int vprintk(const char *fmt, va_list args); |
100 | asmlinkage __attribute__ ((format (printf, 1, 2))) __cold | 100 | asmlinkage __printf(1, 2) __cold |
101 | int printk(const char *fmt, ...); | 101 | int printk(const char *fmt, ...); |
102 | 102 | ||
103 | /* | 103 | /* |
@@ -117,12 +117,12 @@ extern int kptr_restrict; | |||
117 | void log_buf_kexec_setup(void); | 117 | void log_buf_kexec_setup(void); |
118 | void __init setup_log_buf(int early); | 118 | void __init setup_log_buf(int early); |
119 | #else | 119 | #else |
120 | static inline __attribute__ ((format (printf, 1, 0))) | 120 | static inline __printf(1, 0) |
121 | int vprintk(const char *s, va_list args) | 121 | int vprintk(const char *s, va_list args) |
122 | { | 122 | { |
123 | return 0; | 123 | return 0; |
124 | } | 124 | } |
125 | static inline __attribute__ ((format (printf, 1, 2))) __cold | 125 | static inline __printf(1, 2) __cold |
126 | int printk(const char *s, ...) | 126 | int printk(const char *s, ...) |
127 | { | 127 | { |
128 | return 0; | 128 | return 0; |