aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
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 /drivers
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 'drivers')
-rw-r--r--drivers/isdn/hisax/callc.c4
-rw-r--r--drivers/isdn/hisax/hisax.h4
-rw-r--r--drivers/isdn/hisax/isdnl1.h2
-rw-r--r--drivers/isdn/hisax/isdnl3.c2
-rw-r--r--drivers/isdn/hisax/st5481_d.c4
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/mlx4_en.h3
-rw-r--r--drivers/net/wireless/ath/ath.h5
-rw-r--r--drivers/net/wireless/ath/ath5k/debug.h4
-rw-r--r--drivers/net/wireless/ath/ath6kl/debug.h4
-rw-r--r--drivers/net/wireless/b43/b43.h12
-rw-r--r--drivers/net/wireless/b43legacy/b43legacy.h16
-rw-r--r--drivers/staging/iio/trigger.h3
12 files changed, 29 insertions, 34 deletions
diff --git a/drivers/isdn/hisax/callc.c b/drivers/isdn/hisax/callc.c
index 37e685eafd24..c4897e1075d8 100644
--- a/drivers/isdn/hisax/callc.c
+++ b/drivers/isdn/hisax/callc.c
@@ -65,7 +65,7 @@ hisax_findcard(int driverid)
65 return (struct IsdnCardState *) 0; 65 return (struct IsdnCardState *) 0;
66} 66}
67 67
68static __attribute__((format(printf, 3, 4))) void 68static __printf(3, 4) void
69link_debug(struct Channel *chanp, int direction, char *fmt, ...) 69link_debug(struct Channel *chanp, int direction, char *fmt, ...)
70{ 70{
71 va_list args; 71 va_list args;
@@ -1068,7 +1068,7 @@ init_d_st(struct Channel *chanp)
1068 return 0; 1068 return 0;
1069} 1069}
1070 1070
1071static __attribute__((format(printf, 2, 3))) void 1071static __printf(2, 3) void
1072callc_debug(struct FsmInst *fi, char *fmt, ...) 1072callc_debug(struct FsmInst *fi, char *fmt, ...)
1073{ 1073{
1074 va_list args; 1074 va_list args;
diff --git a/drivers/isdn/hisax/hisax.h b/drivers/isdn/hisax/hisax.h
index 0a5c42a3f125..aff45a11a92d 100644
--- a/drivers/isdn/hisax/hisax.h
+++ b/drivers/isdn/hisax/hisax.h
@@ -1287,9 +1287,9 @@ int jiftime(char *s, long mark);
1287 1287
1288int HiSax_command(isdn_ctrl * ic); 1288int HiSax_command(isdn_ctrl * ic);
1289int HiSax_writebuf_skb(int id, int chan, int ack, struct sk_buff *skb); 1289int HiSax_writebuf_skb(int id, int chan, int ack, struct sk_buff *skb);
1290__attribute__((format(printf, 3, 4))) 1290__printf(3, 4)
1291void HiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, ...); 1291void HiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, ...);
1292__attribute__((format(printf, 3, 0))) 1292__printf(3, 0)
1293void VHiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, va_list args); 1293void VHiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, va_list args);
1294void HiSax_reportcard(int cardnr, int sel); 1294void HiSax_reportcard(int cardnr, int sel);
1295int QuickHex(char *txt, u_char * p, int cnt); 1295int QuickHex(char *txt, u_char * p, int cnt);
diff --git a/drivers/isdn/hisax/isdnl1.h b/drivers/isdn/hisax/isdnl1.h
index 425d86116f2b..66ddcab19bba 100644
--- a/drivers/isdn/hisax/isdnl1.h
+++ b/drivers/isdn/hisax/isdnl1.h
@@ -21,7 +21,7 @@
21#define B_XMTBUFREADY 1 21#define B_XMTBUFREADY 1
22#define B_ACKPENDING 2 22#define B_ACKPENDING 2
23 23
24__attribute__((format(printf, 2, 3))) 24__printf(2, 3)
25void debugl1(struct IsdnCardState *cs, char *fmt, ...); 25void debugl1(struct IsdnCardState *cs, char *fmt, ...);
26void DChannel_proc_xmt(struct IsdnCardState *cs); 26void DChannel_proc_xmt(struct IsdnCardState *cs);
27void DChannel_proc_rcv(struct IsdnCardState *cs); 27void DChannel_proc_rcv(struct IsdnCardState *cs);
diff --git a/drivers/isdn/hisax/isdnl3.c b/drivers/isdn/hisax/isdnl3.c
index ad291f21b201..1c24e4457b6f 100644
--- a/drivers/isdn/hisax/isdnl3.c
+++ b/drivers/isdn/hisax/isdnl3.c
@@ -66,7 +66,7 @@ static char *strL3Event[] =
66 "EV_TIMEOUT", 66 "EV_TIMEOUT",
67}; 67};
68 68
69static __attribute__((format(printf, 2, 3))) void 69static __printf(2, 3) void
70l3m_debug(struct FsmInst *fi, char *fmt, ...) 70l3m_debug(struct FsmInst *fi, char *fmt, ...)
71{ 71{
72 va_list args; 72 va_list args;
diff --git a/drivers/isdn/hisax/st5481_d.c b/drivers/isdn/hisax/st5481_d.c
index 44082637a09f..db247b79e561 100644
--- a/drivers/isdn/hisax/st5481_d.c
+++ b/drivers/isdn/hisax/st5481_d.c
@@ -167,7 +167,7 @@ static struct FsmNode L1FnList[] __initdata =
167 {ST_L1_F8, EV_IND_RSY, l1_ignore}, 167 {ST_L1_F8, EV_IND_RSY, l1_ignore},
168}; 168};
169 169
170static __attribute__((format(printf, 2, 3))) 170static __printf(2, 3)
171void l1m_debug(struct FsmInst *fi, char *fmt, ...) 171void l1m_debug(struct FsmInst *fi, char *fmt, ...)
172{ 172{
173 va_list args; 173 va_list args;
@@ -270,7 +270,7 @@ static char *strDoutEvent[] =
270 "EV_DOUT_UNDERRUN", 270 "EV_DOUT_UNDERRUN",
271}; 271};
272 272
273static __attribute__((format(printf, 2, 3))) 273static __printf(2, 3)
274void dout_debug(struct FsmInst *fi, char *fmt, ...) 274void dout_debug(struct FsmInst *fi, char *fmt, ...)
275{ 275{
276 va_list args; 276 va_list args;
diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
index fca66165110e..8fda331c65df 100644
--- a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
+++ b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
@@ -581,8 +581,9 @@ extern const struct ethtool_ops mlx4_en_ethtool_ops;
581 * printk / logging functions 581 * printk / logging functions
582 */ 582 */
583 583
584__printf(3, 4)
584int en_print(const char *level, const struct mlx4_en_priv *priv, 585int en_print(const char *level, const struct mlx4_en_priv *priv,
585 const char *format, ...) __attribute__ ((format (printf, 3, 4))); 586 const char *format, ...);
586 587
587#define en_dbg(mlevel, priv, format, arg...) \ 588#define en_dbg(mlevel, priv, format, arg...) \
588do { \ 589do { \
diff --git a/drivers/net/wireless/ath/ath.h b/drivers/net/wireless/ath/ath.h
index 908fdbc3e0ee..0f9ee46cfc97 100644
--- a/drivers/net/wireless/ath/ath.h
+++ b/drivers/net/wireless/ath/ath.h
@@ -173,8 +173,7 @@ bool ath_hw_keyreset(struct ath_common *common, u16 entry);
173void ath_hw_cycle_counters_update(struct ath_common *common); 173void ath_hw_cycle_counters_update(struct ath_common *common);
174int32_t ath_hw_get_listen_time(struct ath_common *common); 174int32_t ath_hw_get_listen_time(struct ath_common *common);
175 175
176extern __attribute__((format (printf, 2, 3))) 176extern __printf(2, 3) void ath_printk(const char *level, const char *fmt, ...);
177void ath_printk(const char *level, const char *fmt, ...);
178 177
179#define _ath_printk(level, common, fmt, ...) \ 178#define _ath_printk(level, common, fmt, ...) \
180do { \ 179do { \
@@ -258,7 +257,7 @@ do { \
258 257
259#else 258#else
260 259
261static inline __attribute__((format (printf, 3, 4))) 260static inline __attribute__ ((format (printf, 3, 4)))
262void ath_dbg(struct ath_common *common, enum ATH_DEBUG dbg_mask, 261void ath_dbg(struct ath_common *common, enum ATH_DEBUG dbg_mask,
263 const char *fmt, ...) 262 const char *fmt, ...)
264{ 263{
diff --git a/drivers/net/wireless/ath/ath5k/debug.h b/drivers/net/wireless/ath/ath5k/debug.h
index 7f37df3125fd..0a3f916a1ef3 100644
--- a/drivers/net/wireless/ath/ath5k/debug.h
+++ b/drivers/net/wireless/ath/ath5k/debug.h
@@ -141,10 +141,10 @@ ath5k_debug_printtxbuf(struct ath5k_hw *ah, struct ath5k_buf *bf);
141 141
142#include <linux/compiler.h> 142#include <linux/compiler.h>
143 143
144static inline void __attribute__ ((format (printf, 3, 4))) 144static inline __printf(3, 4) void
145ATH5K_DBG(struct ath5k_hw *ah, unsigned int m, const char *fmt, ...) {} 145ATH5K_DBG(struct ath5k_hw *ah, unsigned int m, const char *fmt, ...) {}
146 146
147static inline void __attribute__ ((format (printf, 3, 4))) 147static inline __printf(3, 4) void
148ATH5K_DBG_UNLIMIT(struct ath5k_hw *ah, unsigned int m, const char *fmt, ...) 148ATH5K_DBG_UNLIMIT(struct ath5k_hw *ah, unsigned int m, const char *fmt, ...)
149{} 149{}
150 150
diff --git a/drivers/net/wireless/ath/ath6kl/debug.h b/drivers/net/wireless/ath/ath6kl/debug.h
index 9288a3ce1e39..7b7675f70a10 100644
--- a/drivers/net/wireless/ath/ath6kl/debug.h
+++ b/drivers/net/wireless/ath/ath6kl/debug.h
@@ -44,8 +44,8 @@ enum ATH6K_DEBUG_MASK {
44}; 44};
45 45
46extern unsigned int debug_mask; 46extern unsigned int debug_mask;
47extern int ath6kl_printk(const char *level, const char *fmt, ...) 47extern __printf(2, 3)
48 __attribute__ ((format (printf, 2, 3))); 48int ath6kl_printk(const char *level, const char *fmt, ...);
49 49
50#define ath6kl_info(fmt, ...) \ 50#define ath6kl_info(fmt, ...) \
51 ath6kl_printk(KERN_INFO, fmt, ##__VA_ARGS__) 51 ath6kl_printk(KERN_INFO, fmt, ##__VA_ARGS__)
diff --git a/drivers/net/wireless/b43/b43.h b/drivers/net/wireless/b43/b43.h
index 447a2307c9d9..37110dfd2c96 100644
--- a/drivers/net/wireless/b43/b43.h
+++ b/drivers/net/wireless/b43/b43.h
@@ -1011,14 +1011,10 @@ static inline bool b43_using_pio_transfers(struct b43_wldev *dev)
1011} 1011}
1012 1012
1013/* Message printing */ 1013/* Message printing */
1014void b43info(struct b43_wl *wl, const char *fmt, ...) 1014__printf(2, 3) void b43info(struct b43_wl *wl, const char *fmt, ...);
1015 __attribute__ ((format(printf, 2, 3))); 1015__printf(2, 3) void b43err(struct b43_wl *wl, const char *fmt, ...);
1016void b43err(struct b43_wl *wl, const char *fmt, ...) 1016__printf(2, 3) void b43warn(struct b43_wl *wl, const char *fmt, ...);
1017 __attribute__ ((format(printf, 2, 3))); 1017__printf(2, 3) void b43dbg(struct b43_wl *wl, const char *fmt, ...);
1018void b43warn(struct b43_wl *wl, const char *fmt, ...)
1019 __attribute__ ((format(printf, 2, 3)));
1020void b43dbg(struct b43_wl *wl, const char *fmt, ...)
1021 __attribute__ ((format(printf, 2, 3)));
1022 1018
1023 1019
1024/* A WARN_ON variant that vanishes when b43 debugging is disabled. 1020/* A WARN_ON variant that vanishes when b43 debugging is disabled.
diff --git a/drivers/net/wireless/b43legacy/b43legacy.h b/drivers/net/wireless/b43legacy/b43legacy.h
index 12b518251581..1d4fc9db7f5e 100644
--- a/drivers/net/wireless/b43legacy/b43legacy.h
+++ b/drivers/net/wireless/b43legacy/b43legacy.h
@@ -810,15 +810,15 @@ struct b43legacy_lopair *b43legacy_get_lopair(struct b43legacy_phy *phy,
810 810
811 811
812/* Message printing */ 812/* Message printing */
813void b43legacyinfo(struct b43legacy_wl *wl, const char *fmt, ...) 813__printf(2, 3)
814 __attribute__((format(printf, 2, 3))); 814void b43legacyinfo(struct b43legacy_wl *wl, const char *fmt, ...);
815void b43legacyerr(struct b43legacy_wl *wl, const char *fmt, ...) 815__printf(2, 3)
816 __attribute__((format(printf, 2, 3))); 816void b43legacyerr(struct b43legacy_wl *wl, const char *fmt, ...);
817void b43legacywarn(struct b43legacy_wl *wl, const char *fmt, ...) 817__printf(2, 3)
818 __attribute__((format(printf, 2, 3))); 818void b43legacywarn(struct b43legacy_wl *wl, const char *fmt, ...);
819#if B43legacy_DEBUG 819#if B43legacy_DEBUG
820void b43legacydbg(struct b43legacy_wl *wl, const char *fmt, ...) 820__printf(2, 3)
821 __attribute__((format(printf, 2, 3))); 821void b43legacydbg(struct b43legacy_wl *wl, const char *fmt, ...);
822#else /* DEBUG */ 822#else /* DEBUG */
823# define b43legacydbg(wl, fmt...) do { /* nothing */ } while (0) 823# define b43legacydbg(wl, fmt...) do { /* nothing */ } while (0)
824#endif /* DEBUG */ 824#endif /* DEBUG */
diff --git a/drivers/staging/iio/trigger.h b/drivers/staging/iio/trigger.h
index 598fcb3599f9..5cc42a655c88 100644
--- a/drivers/staging/iio/trigger.h
+++ b/drivers/staging/iio/trigger.h
@@ -115,8 +115,7 @@ void iio_trigger_poll_chained(struct iio_trigger *trig, s64 time);
115 115
116irqreturn_t iio_trigger_generic_data_rdy_poll(int irq, void *private); 116irqreturn_t iio_trigger_generic_data_rdy_poll(int irq, void *private);
117 117
118struct iio_trigger *iio_allocate_trigger(const char *fmt, ...) 118__printf(1, 2) struct iio_trigger *iio_allocate_trigger(const char *fmt, ...);
119 __attribute__((format(printf, 1, 2)));
120void iio_free_trigger(struct iio_trigger *trig); 119void iio_free_trigger(struct iio_trigger *trig);
121 120
122#endif /* _IIO_TRIGGER_H_ */ 121#endif /* _IIO_TRIGGER_H_ */