aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2011-10-31 20:11:33 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-10-31 20:30:54 -0400
commitb9075fa968a0a4347aef35e235e2995c0e57dddd (patch)
treecf9f9716784e790d8a43339653256d9cf9178ff3 /net
parentae29bc92da01a2e9d278a9a58c3b307d41cc0254 (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')
-rw-r--r--net/nfc/nfc.h2
-rw-r--r--net/rds/rds.h8
-rw-r--r--net/sunrpc/svc.c5
3 files changed, 7 insertions, 8 deletions
diff --git a/net/nfc/nfc.h b/net/nfc/nfc.h
index b6753f45624..d86583f4831 100644
--- a/net/nfc/nfc.h
+++ b/net/nfc/nfc.h
@@ -27,7 +27,7 @@
27#include <net/nfc/nfc.h> 27#include <net/nfc/nfc.h>
28#include <net/sock.h> 28#include <net/sock.h>
29 29
30__attribute__((format (printf, 2, 3))) 30__printf(2, 3)
31int nfc_printk(const char *level, const char *fmt, ...); 31int nfc_printk(const char *level, const char *fmt, ...);
32 32
33#define nfc_info(fmt, arg...) nfc_printk(KERN_INFO, fmt, ##arg) 33#define nfc_info(fmt, arg...) nfc_printk(KERN_INFO, fmt, ##arg)
diff --git a/net/rds/rds.h b/net/rds/rds.h
index da8adac2bf0..7eaba1831f0 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 */
39static inline void __attribute__ ((format (printf, 1, 2))) 39static inline __printf(1, 2)
40rdsdebug(char *fmt, ...) 40void 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);
628void __rds_conn_error(struct rds_connection *conn, const char *, ...) 628__printf(2, 3)
629 __attribute__ ((format (printf, 2, 3))); 629void __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
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index 30d70abb4e2..dd5cc00ed55 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -971,9 +971,8 @@ static void svc_unregister(const struct svc_serv *serv)
971/* 971/*
972 * Printk the given error with the address of the client that caused it. 972 * Printk the given error with the address of the client that caused it.
973 */ 973 */
974static int 974static __printf(2, 3)
975__attribute__ ((format (printf, 2, 3))) 975int svc_printk(struct svc_rqst *rqstp, const char *fmt, ...)
976svc_printk(struct svc_rqst *rqstp, const char *fmt, ...)
977{ 976{
978 va_list args; 977 va_list args;
979 int r; 978 int r;