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 /fs/xfs | |
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 'fs/xfs')
-rw-r--r-- | fs/xfs/xfs_message.h | 42 |
1 files changed, 20 insertions, 22 deletions
diff --git a/fs/xfs/xfs_message.h b/fs/xfs/xfs_message.h index 7fb7ea007672..56dc0c17f16a 100644 --- a/fs/xfs/xfs_message.h +++ b/fs/xfs/xfs_message.h | |||
@@ -3,31 +3,29 @@ | |||
3 | 3 | ||
4 | struct xfs_mount; | 4 | struct xfs_mount; |
5 | 5 | ||
6 | extern void xfs_emerg(const struct xfs_mount *mp, const char *fmt, ...) | 6 | extern __printf(2, 3) |
7 | __attribute__ ((format (printf, 2, 3))); | 7 | void xfs_emerg(const struct xfs_mount *mp, const char *fmt, ...); |
8 | extern void xfs_alert(const struct xfs_mount *mp, const char *fmt, ...) | 8 | extern __printf(2, 3) |
9 | __attribute__ ((format (printf, 2, 3))); | 9 | void xfs_alert(const struct xfs_mount *mp, const char *fmt, ...); |
10 | extern void xfs_alert_tag(const struct xfs_mount *mp, int tag, | 10 | extern __printf(3, 4) |
11 | const char *fmt, ...) | 11 | void xfs_alert_tag(const struct xfs_mount *mp, int tag, const char *fmt, ...); |
12 | __attribute__ ((format (printf, 3, 4))); | 12 | extern __printf(2, 3) |
13 | extern void xfs_crit(const struct xfs_mount *mp, const char *fmt, ...) | 13 | void xfs_crit(const struct xfs_mount *mp, const char *fmt, ...); |
14 | __attribute__ ((format (printf, 2, 3))); | 14 | extern __printf(2, 3) |
15 | extern void xfs_err(const struct xfs_mount *mp, const char *fmt, ...) | 15 | void xfs_err(const struct xfs_mount *mp, const char *fmt, ...); |
16 | __attribute__ ((format (printf, 2, 3))); | 16 | extern __printf(2, 3) |
17 | extern void xfs_warn(const struct xfs_mount *mp, const char *fmt, ...) | 17 | void xfs_warn(const struct xfs_mount *mp, const char *fmt, ...); |
18 | __attribute__ ((format (printf, 2, 3))); | 18 | extern __printf(2, 3) |
19 | extern void xfs_notice(const struct xfs_mount *mp, const char *fmt, ...) | 19 | void xfs_notice(const struct xfs_mount *mp, const char *fmt, ...); |
20 | __attribute__ ((format (printf, 2, 3))); | 20 | extern __printf(2, 3) |
21 | extern void xfs_info(const struct xfs_mount *mp, const char *fmt, ...) | 21 | void xfs_info(const struct xfs_mount *mp, const char *fmt, ...); |
22 | __attribute__ ((format (printf, 2, 3))); | ||
23 | 22 | ||
24 | #ifdef DEBUG | 23 | #ifdef DEBUG |
25 | extern void xfs_debug(const struct xfs_mount *mp, const char *fmt, ...) | 24 | extern __printf(2, 3) |
26 | __attribute__ ((format (printf, 2, 3))); | 25 | void xfs_debug(const struct xfs_mount *mp, const char *fmt, ...); |
27 | #else | 26 | #else |
28 | static inline void | 27 | static inline __printf(2, 3) |
29 | __attribute__ ((format (printf, 2, 3))) | 28 | void xfs_debug(const struct xfs_mount *mp, const char *fmt, ...) |
30 | xfs_debug(const struct xfs_mount *mp, const char *fmt, ...) | ||
31 | { | 29 | { |
32 | } | 30 | } |
33 | #endif | 31 | #endif |