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 /net/rds | |
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 'net/rds')
-rw-r--r-- | net/rds/rds.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/rds/rds.h b/net/rds/rds.h index da8adac2bf06..7eaba1831f0d 100644 --- a/net/rds/rds.h +++ b/net/rds/rds.h | |||
@@ -36,8 +36,8 @@ | |||
36 | #define rdsdebug(fmt, args...) pr_debug("%s(): " fmt, __func__ , ##args) | 36 | #define rdsdebug(fmt, args...) pr_debug("%s(): " fmt, __func__ , ##args) |
37 | #else | 37 | #else |
38 | /* sigh, pr_debug() causes unused variable warnings */ | 38 | /* sigh, pr_debug() causes unused variable warnings */ |
39 | static inline void __attribute__ ((format (printf, 1, 2))) | 39 | static inline __printf(1, 2) |
40 | rdsdebug(char *fmt, ...) | 40 | void rdsdebug(char *fmt, ...) |
41 | { | 41 | { |
42 | } | 42 | } |
43 | #endif | 43 | #endif |
@@ -625,8 +625,8 @@ void rds_for_each_conn_info(struct socket *sock, unsigned int len, | |||
625 | struct rds_info_lengths *lens, | 625 | struct rds_info_lengths *lens, |
626 | int (*visitor)(struct rds_connection *, void *), | 626 | int (*visitor)(struct rds_connection *, void *), |
627 | size_t item_len); | 627 | size_t item_len); |
628 | void __rds_conn_error(struct rds_connection *conn, const char *, ...) | 628 | __printf(2, 3) |
629 | __attribute__ ((format (printf, 2, 3))); | 629 | void __rds_conn_error(struct rds_connection *conn, const char *, ...); |
630 | #define rds_conn_error(conn, fmt...) \ | 630 | #define rds_conn_error(conn, fmt...) \ |
631 | __rds_conn_error(conn, KERN_WARNING "RDS: " fmt) | 631 | __rds_conn_error(conn, KERN_WARNING "RDS: " fmt) |
632 | 632 | ||