]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
treewide: use __printf not __attribute__((format(printf,...)))
authorJoe Perches <joe@perches.com>
Wed, 5 Oct 2011 00:43:29 +0000 (11:43 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 13 Oct 2011 06:49:39 +0000 (17:49 +1100)
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; }'

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
72 files changed:
arch/alpha/boot/misc.c
arch/alpha/include/asm/console.h
arch/frv/include/asm/system.h
arch/ia64/include/asm/mca.h
arch/m68k/include/asm/natfeat.h
arch/mn10300/include/asm/gdb-stub.h
arch/powerpc/boot/ps3.c
arch/powerpc/boot/stdio.h
arch/powerpc/include/asm/udbg.h
arch/s390/include/asm/debug.h
arch/um/include/shared/user.h
drivers/isdn/hisax/callc.c
drivers/isdn/hisax/hisax.h
drivers/isdn/hisax/isdnl1.h
drivers/isdn/hisax/isdnl3.c
drivers/isdn/hisax/st5481_d.c
drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
drivers/net/wireless/ath/ath.h
drivers/net/wireless/ath/ath5k/debug.h
drivers/net/wireless/ath/ath6kl/debug.h
drivers/net/wireless/b43/b43.h
drivers/net/wireless/b43legacy/b43legacy.h
drivers/staging/iio/trigger.h
fs/ecryptfs/ecryptfs_kernel.h
fs/ext2/ext2.h
fs/ext4/ext4.h
fs/fat/fat.h
fs/gfs2/glock.h
fs/hpfs/hpfs_fn.h
fs/nilfs2/nilfs.h
fs/ntfs/debug.h
fs/ocfs2/super.h
fs/partitions/ldm.c
fs/udf/udfdecl.h
fs/ufs/ufs.h
fs/xfs/xfs_message.h
include/asm-generic/bug.h
include/drm/drmP.h
include/linux/audit.h
include/linux/blktrace_api.h
include/linux/device.h
include/linux/dynamic_debug.h
include/linux/ext3_fs.h
include/linux/fs.h
include/linux/fscache-cache.h
include/linux/gameport.h
include/linux/kallsyms.h
include/linux/kdb.h
include/linux/kernel.h
include/linux/kexec.h
include/linux/kmod.h
include/linux/kobject.h
include/linux/kthread.h
include/linux/libata.h
include/linux/mmiotrace.h
include/linux/netdevice.h
include/linux/printk.h
include/linux/quotaops.h
include/linux/seq_file.h
include/linux/trace_seq.h
include/net/bluetooth/bluetooth.h
include/net/netfilter/nf_log.h
include/net/sock.h
include/sound/core.h
include/sound/info.h
include/sound/seq_kernel.h
include/xen/hvc-console.h
include/xen/xenbus.h
net/nfc/nfc.h
net/rds/rds.h
net/sunrpc/svc.c
sound/firewire/cmp.c

index 3ff9a957a25cdc8b89e3eda0656e54a5a3af79ec..e6ab68c18a6cc77d0a9a15ad078c5aca042d7126 100644 (file)
@@ -25,8 +25,7 @@
 
 #define memzero(s,n)   memset ((s),0,(n))
 #define puts           srm_printk
-extern long srm_printk(const char *, ...)
-     __attribute__ ((format (printf, 1, 2)));
+extern __printf(1, 2) long srm_printk(const char *, ...);
 
 /*
  * gzip delarations
index a3ce4e62249baadeca127666a0734f95295ac130..1490c3d0d4ce001feea6fa50e7db7a0e30abd782 100644 (file)
@@ -62,8 +62,7 @@ extern long callback_save_env(void);
 extern int srm_fixup(unsigned long new_callback_addr,
                     unsigned long new_hwrpb_addr);
 extern long srm_puts(const char *, long);
-extern long srm_printk(const char *, ...)
-       __attribute__ ((format (printf, 1, 2)));
+extern __printf(1, 2) long srm_printk(const char *, ...);
 
 struct crb_struct;
 struct hwrpb_struct;
index 6c10fd2c626ddde848763573e7caf769f479e42f..eb8adb6da87eb7048b69ce56b0d132b784e43c89 100644 (file)
@@ -52,7 +52,7 @@ do {                                                                  \
 #define set_mb(var, value) \
        do { var = (value); barrier(); } while (0)
 
-extern void die_if_kernel(const char *, ...) __attribute__((format(printf, 1, 2)));
+extern  __printf(1, 2) void die_if_kernel(const char *, ...);
 extern void free_initmem(void);
 
 #define arch_align_stack(x) (x)
index 43f96ab18fa0d2754ff5f79374c02e785ec24347..f10fce384c24d3d5a6298e97574b22ffdb058dce 100644 (file)
@@ -158,8 +158,7 @@ extern int  ia64_reg_MCA_extension(int (*fn)(void *, struct ia64_sal_os_state *)
 extern void ia64_unreg_MCA_extension(void);
 extern unsigned long ia64_get_rnat(unsigned long *);
 extern void ia64_set_psr_mc(void);
-extern void ia64_mca_printk(const char * fmt, ...)
-        __attribute__ ((format (printf, 1, 2)));
+extern __printf(1, 2) void ia64_mca_printk(const char *fmt, ...);
 
 struct ia64_mca_notify_die {
        struct ia64_sal_os_state *sos;
index a3521b80c3b970c1aa4ddadc38654344ed6e108b..e8da1583eff424dd9b3d07a36e1808555c3f70e3 100644 (file)
@@ -16,7 +16,6 @@ long nf_call(long id, ...);
 void nf_init(void);
 void nf_shutdown(void);
 
-void nfprint(const char *fmt, ...)
-       __attribute__ ((format (printf, 1, 2)));
+__printf(1, 2) void nfprint(const char *fmt, ...);
 
 # endif /* _NATFEAT_H */
index f5495ad82b77bc753b218b3a3498ea089e511134..2549bd5bf8ebea370d539ce1d7c9b4ed8bf4ecc0 100644 (file)
@@ -145,10 +145,9 @@ extern u8  gdbstub_busy;
 extern u8      gdbstub_rx_unget;
 
 #ifdef CONFIG_GDBSTUB_DEBUGGING
-extern void gdbstub_printk(const char *fmt, ...)
-       __attribute__((format(printf, 1, 2)));
+extern __printf(1, 2) void gdbstub_printk(const char *fmt, ...);
 #else
-static inline __attribute__((format(printf, 1, 2)))
+static inline __printf(1, 2)
 void gdbstub_printk(const char *fmt, ...)
 {
 }
index 9954d98871d061dfc9abb8c33fefcbbe00d8d2ea..7e3f94cc338dad95f70a23aad0c4ad9f6e31858a 100644 (file)
@@ -36,8 +36,7 @@ extern int lv1_get_repository_node_value(u64 in_1, u64 in_2, u64 in_3,
 #ifdef DEBUG
 #define DBG(fmt...) printf(fmt)
 #else
-static inline int __attribute__ ((format (printf, 1, 2))) DBG(
-       const char *fmt, ...) {return 0;}
+static inline __printf(1, 2) int DBG(const char *fmt, ...) {return 0;}
 #endif
 
 BSS_STACK(4096);
index adffc58412d4afcd8cf2e25c579fc1abcfe6a689..756fc04331c47136ef7a33f60c0cd72af96fd17a 100644 (file)
@@ -7,12 +7,11 @@
 #define        EINVAL          22      /* Invalid argument */
 #define ENOSPC         28      /* No space left on device */
 
-extern int printf(const char *fmt, ...) __attribute__((format(printf, 1, 2)));
+extern __printf(1, 2) int printf(const char *fmt, ...);
 
 #define fprintf(fmt, args...)  printf(args)
 
-extern int sprintf(char *buf, const char *fmt, ...)
-       __attribute__((format(printf, 2, 3)));
+extern __printf(2, 3) int sprintf(char *buf, const char *fmt, ...);
 
 extern int vsprintf(char *buf, const char *fmt, va_list args);
 
index 7efc08eccfa191f4d4e0bbdb7226fd6b3eec9489..fbb90ceb84dbe7adcae01dd6667cbf44f545d7c8 100644 (file)
@@ -24,8 +24,7 @@ extern int udbg_write(const char *s, int n);
 extern int udbg_read(char *buf, int buflen);
 
 extern void register_early_udbg_console(void);
-extern void udbg_printf(const char *fmt, ...)
-       __attribute__ ((format (printf, 1, 2)));
+extern __printf(1, 2) void udbg_printf(const char *fmt, ...);
 extern void udbg_progress(char *s, unsigned short hex);
 
 extern void udbg_init_uart(void __iomem *comport, unsigned int speed,
index 18124b75a7ab3038165ff59dfb9101a7ac35323e..cea7114ce57dd6d1b77516811e67a116938ff39f 100644 (file)
@@ -171,10 +171,8 @@ debug_text_event(debug_info_t* id, int level, const char* txt)
  * IMPORTANT: Use "%s" in sprintf format strings with care! Only pointers are
  * stored in the s390dbf. See Documentation/s390/s390dbf.txt for more details!
  */
-extern debug_entry_t *
-debug_sprintf_event(debug_info_t* id,int level,char *string,...)
-       __attribute__ ((format(printf, 3, 4)));
-
+extern __printf(3, 4) debug_entry_t *
+debug_sprintf_event(debug_info_t* id, int level, char *string, ...);
 
 static inline debug_entry_t*
 debug_exception(debug_info_t* id, int level, void* data, int length)
@@ -214,9 +212,8 @@ debug_text_exception(debug_info_t* id, int level, const char* txt)
  * IMPORTANT: Use "%s" in sprintf format strings with care! Only pointers are
  * stored in the s390dbf. See Documentation/s390/s390dbf.txt for more details!
  */
-extern debug_entry_t *
-debug_sprintf_exception(debug_info_t* id,int level,char *string,...)
-       __attribute__ ((format(printf, 3, 4)));
+extern __printf(3, 4) debug_entry_t *
+debug_sprintf_exception(debug_info_t *id, int level, char *string,...);
 
 int debug_register_view(debug_info_t* id, struct debug_view* view);
 int debug_unregister_view(debug_info_t* id, struct debug_view* view);
index 293f7c794faa46a38c4767125d5d37201c72c675..e253af96ec95d444fdc6787828e21543ac2f0f6c 100644 (file)
 #include <stddef.h>
 #endif
 
-extern void panic(const char *fmt, ...)
-       __attribute__ ((format (printf, 1, 2)));
+extern __printf(1, 2) void panic(const char *fmt, ...);
 
 #ifdef UML_CONFIG_PRINTK
-extern int printk(const char *fmt, ...)
-       __attribute__ ((format (printf, 1, 2)));
+extern __printf(1, 2) int printk(const char *fmt, ...);
 #else
-static inline int printk(const char *fmt, ...)
+static inline __printf(1, 2) int printk(const char *fmt, ...)
 {
        return 0;
 }
index 37e685eafd24a015ba5a61c62193bbceb82eb054..c4897e1075d8ce9bf9ade33fa76b41e1814ec49b 100644 (file)
@@ -65,7 +65,7 @@ hisax_findcard(int driverid)
        return (struct IsdnCardState *) 0;
 }
 
-static __attribute__((format(printf, 3, 4))) void
+static __printf(3, 4) void
 link_debug(struct Channel *chanp, int direction, char *fmt, ...)
 {
        va_list args;
@@ -1068,7 +1068,7 @@ init_d_st(struct Channel *chanp)
        return 0;
 }
 
-static __attribute__((format(printf, 2, 3))) void
+static __printf(2, 3) void
 callc_debug(struct FsmInst *fi, char *fmt, ...)
 {
        va_list args;
index 0a5c42a3f125667b8705c110270c727d82c6c91b..aff45a11a92d49f7f5f5dc245a9c709faee38396 100644 (file)
@@ -1287,9 +1287,9 @@ int jiftime(char *s, long mark);
 
 int HiSax_command(isdn_ctrl * ic);
 int HiSax_writebuf_skb(int id, int chan, int ack, struct sk_buff *skb);
-__attribute__((format(printf, 3, 4)))
+__printf(3, 4)
 void HiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, ...);
-__attribute__((format(printf, 3, 0)))
+__printf(3, 0)
 void VHiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, va_list args);
 void HiSax_reportcard(int cardnr, int sel);
 int QuickHex(char *txt, u_char * p, int cnt);
index 425d86116f2bbb40c62200e2c23218f6c0ea015c..66ddcab19bbae757415ba0ae40cb41947f08b2fd 100644 (file)
@@ -21,7 +21,7 @@
 #define B_XMTBUFREADY  1
 #define B_ACKPENDING   2
 
-__attribute__((format(printf, 2, 3)))
+__printf(2, 3)
 void debugl1(struct IsdnCardState *cs, char *fmt, ...);
 void DChannel_proc_xmt(struct IsdnCardState *cs);
 void DChannel_proc_rcv(struct IsdnCardState *cs);
index ad291f21b201394d5e0340d29e0e51d1feb8d2b1..1c24e4457b6fc628b2d1ceeb318c3e30f71aa832 100644 (file)
@@ -66,7 +66,7 @@ static char *strL3Event[] =
        "EV_TIMEOUT",
 };
 
-static __attribute__((format(printf, 2, 3))) void
+static __printf(2, 3) void
 l3m_debug(struct FsmInst *fi, char *fmt, ...)
 {
        va_list args;
index 44082637a09fbcfe71701dc69c07fdbcca9c54c4..db247b79e561eb66277b5918fa4642defcdd7363 100644 (file)
@@ -167,7 +167,7 @@ static struct FsmNode L1FnList[] __initdata =
        {ST_L1_F8, EV_IND_RSY,           l1_ignore},
 };
 
-static __attribute__((format(printf, 2, 3)))
+static __printf(2, 3)
 void l1m_debug(struct FsmInst *fi, char *fmt, ...)
 {
        va_list args;
@@ -270,7 +270,7 @@ static char *strDoutEvent[] =
        "EV_DOUT_UNDERRUN",
 };
 
-static __attribute__((format(printf, 2, 3)))
+static __printf(2, 3)
 void dout_debug(struct FsmInst *fi, char *fmt, ...)
 {
        va_list args;
index 3b753f7b866a85ed166946fb0b8c58ce996b84e0..79bef43e3852d6942fe6ceba865d11375616d784 100644 (file)
@@ -578,8 +578,9 @@ extern const struct ethtool_ops mlx4_en_ethtool_ops;
  * printk / logging functions
  */
 
+__printf(3, 4)
 int en_print(const char *level, const struct mlx4_en_priv *priv,
-            const char *format, ...) __attribute__ ((format (printf, 3, 4)));
+            const char *format, ...);
 
 #define en_dbg(mlevel, priv, format, arg...)                   \
 do {                                                           \
index 908fdbc3e0eeaaef62523ee5828d50e760f8e627..0f9ee46cfc970eb8b898bf215bb48099165758de 100644 (file)
@@ -173,8 +173,7 @@ bool ath_hw_keyreset(struct ath_common *common, u16 entry);
 void ath_hw_cycle_counters_update(struct ath_common *common);
 int32_t ath_hw_get_listen_time(struct ath_common *common);
 
-extern __attribute__((format (printf, 2, 3)))
-void ath_printk(const char *level, const char *fmt, ...);
+extern __printf(2, 3) void ath_printk(const char *level, const char *fmt, ...);
 
 #define _ath_printk(level, common, fmt, ...)                   \
 do {                                                           \
@@ -258,7 +257,7 @@ do {                                                                        \
 
 #else
 
-static inline  __attribute__((format (printf, 3, 4)))
+static inline  __attribute__ ((format (printf, 3, 4)))
 void ath_dbg(struct ath_common *common, enum ATH_DEBUG dbg_mask,
             const char *fmt, ...)
 {
index 7f37df3125fd3852a8d76dd498dd188a39b7347e..0a3f916a1ef32fa3260534e8658e65bbb0a77106 100644 (file)
@@ -141,10 +141,10 @@ ath5k_debug_printtxbuf(struct ath5k_hw *ah, struct ath5k_buf *bf);
 
 #include <linux/compiler.h>
 
-static inline void __attribute__ ((format (printf, 3, 4)))
+static inline __printf(3, 4) void
 ATH5K_DBG(struct ath5k_hw *ah, unsigned int m, const char *fmt, ...) {}
 
-static inline void __attribute__ ((format (printf, 3, 4)))
+static inline __printf(3, 4) void
 ATH5K_DBG_UNLIMIT(struct ath5k_hw *ah, unsigned int m, const char *fmt, ...)
 {}
 
index 9288a3ce1e399446fada3406c5659e0dbe5d8a40..7b7675f70a102a585a6fc1be257242b1c63d496b 100644 (file)
@@ -44,8 +44,8 @@ enum ATH6K_DEBUG_MASK {
 };
 
 extern unsigned int debug_mask;
-extern int ath6kl_printk(const char *level, const char *fmt, ...)
-       __attribute__ ((format (printf, 2, 3)));
+extern __printf(2, 3)
+int ath6kl_printk(const char *level, const char *fmt, ...);
 
 #define ath6kl_info(fmt, ...)                          \
        ath6kl_printk(KERN_INFO, fmt, ##__VA_ARGS__)
index 447a2307c9d9ae2bdb7657c2f0160f978c8e55e9..37110dfd2c9627ff436379c8305151c0d6ff2e24 100644 (file)
@@ -1011,14 +1011,10 @@ static inline bool b43_using_pio_transfers(struct b43_wldev *dev)
 }
 
 /* Message printing */
-void b43info(struct b43_wl *wl, const char *fmt, ...)
-    __attribute__ ((format(printf, 2, 3)));
-void b43err(struct b43_wl *wl, const char *fmt, ...)
-    __attribute__ ((format(printf, 2, 3)));
-void b43warn(struct b43_wl *wl, const char *fmt, ...)
-    __attribute__ ((format(printf, 2, 3)));
-void b43dbg(struct b43_wl *wl, const char *fmt, ...)
-    __attribute__ ((format(printf, 2, 3)));
+__printf(2, 3) void b43info(struct b43_wl *wl, const char *fmt, ...);
+__printf(2, 3) void b43err(struct b43_wl *wl, const char *fmt, ...);
+__printf(2, 3) void b43warn(struct b43_wl *wl, const char *fmt, ...);
+__printf(2, 3) void b43dbg(struct b43_wl *wl, const char *fmt, ...);
 
 
 /* A WARN_ON variant that vanishes when b43 debugging is disabled.
index 12b5182515816e76d60fc08dd6ed2d54e43ac91b..1d4fc9db7f5e31863f1467696305076be882506b 100644 (file)
@@ -810,15 +810,15 @@ struct b43legacy_lopair *b43legacy_get_lopair(struct b43legacy_phy *phy,
 
 
 /* Message printing */
-void b43legacyinfo(struct b43legacy_wl *wl, const char *fmt, ...)
-               __attribute__((format(printf, 2, 3)));
-void b43legacyerr(struct b43legacy_wl *wl, const char *fmt, ...)
-               __attribute__((format(printf, 2, 3)));
-void b43legacywarn(struct b43legacy_wl *wl, const char *fmt, ...)
-               __attribute__((format(printf, 2, 3)));
+__printf(2, 3)
+void b43legacyinfo(struct b43legacy_wl *wl, const char *fmt, ...);
+__printf(2, 3)
+void b43legacyerr(struct b43legacy_wl *wl, const char *fmt, ...);
+__printf(2, 3)
+void b43legacywarn(struct b43legacy_wl *wl, const char *fmt, ...);
 #if B43legacy_DEBUG
-void b43legacydbg(struct b43legacy_wl *wl, const char *fmt, ...)
-               __attribute__((format(printf, 2, 3)));
+__printf(2, 3)
+void b43legacydbg(struct b43legacy_wl *wl, const char *fmt, ...);
 #else /* DEBUG */
 # define b43legacydbg(wl, fmt...) do { /* nothing */ } while (0)
 #endif /* DEBUG */
index 598fcb3599f90cab87db6d231385d3c4aefddf10..5cc42a655c8857962689ec7421a49113ba5538a9 100644 (file)
@@ -115,8 +115,7 @@ void iio_trigger_poll_chained(struct iio_trigger *trig, s64 time);
 
 irqreturn_t iio_trigger_generic_data_rdy_poll(int irq, void *private);
 
-struct iio_trigger *iio_allocate_trigger(const char *fmt, ...)
-       __attribute__((format(printf, 1, 2)));
+__printf(1, 2) struct iio_trigger *iio_allocate_trigger(const char *fmt, ...);
 void iio_free_trigger(struct iio_trigger *trig);
 
 #endif /* _IIO_TRIGGER_H_ */
index b36c5572b3f3739c1cae2d970d14196ed10d8ceb..54481a3b2c7960e6ba205696c9d69ec44b331194 100644 (file)
@@ -514,7 +514,7 @@ ecryptfs_set_dentry_lower_mnt(struct dentry *dentry, struct vfsmount *lower_mnt)
 
 #define ecryptfs_printk(type, fmt, arg...) \
         __ecryptfs_printk(type "%s: " fmt, __func__, ## arg);
-__attribute__ ((format(printf, 1, 2)))
+__printf(1, 2)
 void __ecryptfs_printk(const char *fmt, ...);
 
 extern const struct file_operations ecryptfs_main_fops;
index af9fc89b1b2d3e92994e63db97023f2ebf32ecac..4f4921c27ee2d087d2f3afd18394e491a98f301e 100644 (file)
@@ -135,10 +135,10 @@ extern long ext2_compat_ioctl(struct file *, unsigned int, unsigned long);
 struct dentry *ext2_get_parent(struct dentry *child);
 
 /* super.c */
-extern void ext2_error (struct super_block *, const char *, const char *, ...)
-       __attribute__ ((format (printf, 3, 4)));
-extern void ext2_msg(struct super_block *, const char *, const char *, ...)
-       __attribute__ ((format (printf, 3, 4)));
+extern __printf(3, 4)
+void ext2_error (struct super_block *, const char *, const char *, ...);
+extern __printf(3, 4)
+void ext2_msg(struct super_block *, const char *, const char *, ...);
 extern void ext2_update_dynamic_rev (struct super_block *sb);
 extern void ext2_write_super (struct super_block *);
 
index 47deef45bea66101ac4ec992c197c9cce2926e8b..760b1120dce277d5f63f379ba165a087db71a71b 100644 (file)
@@ -1918,40 +1918,40 @@ extern int ext4_group_extend(struct super_block *sb,
 extern void *ext4_kvmalloc(size_t size, gfp_t flags);
 extern void *ext4_kvzalloc(size_t size, gfp_t flags);
 extern void ext4_kvfree(void *ptr);
-extern void __ext4_error(struct super_block *, const char *, unsigned int,
-                        const char *, ...)
-       __attribute__ ((format (printf, 4, 5)));
+extern __printf(4, 5)
+void __ext4_error(struct super_block *, const char *, unsigned int,
+                 const char *, ...);
 #define ext4_error(sb, message...)     __ext4_error(sb, __func__,      \
                                                     __LINE__, ## message)
-extern void ext4_error_inode(struct inode *, const char *, unsigned int,
-                            ext4_fsblk_t, const char *, ...)
-       __attribute__ ((format (printf, 5, 6)));
-extern void ext4_error_file(struct file *, const char *, unsigned int,
-                           ext4_fsblk_t, const char *, ...)
-       __attribute__ ((format (printf, 5, 6)));
+extern __printf(5, 6)
+void ext4_error_inode(struct inode *, const char *, unsigned int, ext4_fsblk_t,
+                     const char *, ...);
+extern __printf(5, 6)
+void ext4_error_file(struct file *, const char *, unsigned int, ext4_fsblk_t,
+                    const char *, ...);
 extern void __ext4_std_error(struct super_block *, const char *,
                             unsigned int, int);
-extern void __ext4_abort(struct super_block *, const char *, unsigned int,
-                      const char *, ...)
-       __attribute__ ((format (printf, 4, 5)));
+extern __printf(4, 5)
+void __ext4_abort(struct super_block *, const char *, unsigned int,
+                 const char *, ...);
 #define ext4_abort(sb, message...)     __ext4_abort(sb, __func__, \
                                                       __LINE__, ## message)
-extern void __ext4_warning(struct super_block *, const char *, unsigned int,
-                         const char *, ...)
-       __attribute__ ((format (printf, 4, 5)));
+extern __printf(4, 5)
+void __ext4_warning(struct super_block *, const char *, unsigned int,
+                   const char *, ...);
 #define ext4_warning(sb, message...)   __ext4_warning(sb, __func__, \
                                                       __LINE__, ## message)
-extern void ext4_msg(struct super_block *, const char *, const char *, ...)
-       __attribute__ ((format (printf, 3, 4)));
+extern __printf(3, 4)
+void ext4_msg(struct super_block *, const char *, const char *, ...);
 extern void __dump_mmp_msg(struct super_block *, struct mmp_struct *mmp,
                           const char *, unsigned int, const char *);
 #define dump_mmp_msg(sb, mmp, msg)     __dump_mmp_msg(sb, mmp, __func__, \
                                                       __LINE__, msg)
-extern void __ext4_grp_locked_error(const char *, unsigned int, \
-                                   struct super_block *, ext4_group_t, \
-                                   unsigned long, ext4_fsblk_t, \
-                                   const char *, ...)
-       __attribute__ ((format (printf, 7, 8)));
+extern __printf(7, 8)
+void __ext4_grp_locked_error(const char *, unsigned int,
+                            struct super_block *, ext4_group_t,
+                            unsigned long, ext4_fsblk_t,
+                            const char *, ...);
 #define ext4_grp_locked_error(sb, grp, message...) \
        __ext4_grp_locked_error(__func__, __LINE__, (sb), (grp), ## message)
 extern void ext4_update_dynamic_rev(struct super_block *sb);
index a5d3853822e07b68f5434007725ddf4acec0330f..1510a4d5199002bb9b7744e9301120fc691dbf28 100644 (file)
@@ -326,15 +326,14 @@ extern int fat_fill_super(struct super_block *sb, void *data, int silent,
 extern int fat_flush_inodes(struct super_block *sb, struct inode *i1,
                            struct inode *i2);
 /* fat/misc.c */
-extern void
-__fat_fs_error(struct super_block *sb, int report, const char *fmt, ...)
-       __attribute__ ((format (printf, 3, 4))) __cold;
+extern __printf(3, 4) __cold
+void __fat_fs_error(struct super_block *sb, int report, const char *fmt, ...);
 #define fat_fs_error(sb, fmt, args...)         \
        __fat_fs_error(sb, 1, fmt , ## args)
 #define fat_fs_error_ratelimit(sb, fmt, args...) \
        __fat_fs_error(sb, __ratelimit(&MSDOS_SB(sb)->ratelimit), fmt , ## args)
-void fat_msg(struct super_block *sb, const char *level, const char *fmt, ...)
-       __attribute__ ((format (printf, 3, 4))) __cold;
+__printf(3, 4) __cold
+void fat_msg(struct super_block *sb, const char *level, const char *fmt, ...);
 extern int fat_clusters_flush(struct super_block *sb);
 extern int fat_chain_add(struct inode *inode, int new_dclus, int nr_cluster);
 extern void fat_time_fat2unix(struct msdos_sb_info *sbi, struct timespec *ts,
index 66707118af2512be474bda424c232b2eb5813c4c..2553b858a72e8374b04ea765938da1eacb7d925c 100644 (file)
@@ -201,7 +201,7 @@ int gfs2_glock_nq_m(unsigned int num_gh, struct gfs2_holder *ghs);
 void gfs2_glock_dq_m(unsigned int num_gh, struct gfs2_holder *ghs);
 void gfs2_glock_dq_uninit_m(unsigned int num_gh, struct gfs2_holder *ghs);
 
-__attribute__ ((format(printf, 2, 3)))
+__printf(2, 3)
 void gfs2_print_dbg(struct seq_file *seq, const char *fmt, ...);
 
 /**
index 331b5e234ef3aca66c93c27f7f90fd357b14f8d3..de946170ebb1092937a1efd5f8dbd104f064d170 100644 (file)
@@ -311,8 +311,8 @@ static inline struct hpfs_sb_info *hpfs_sb(struct super_block *sb)
 
 /* super.c */
 
-void hpfs_error(struct super_block *, const char *, ...)
-       __attribute__((format (printf, 2, 3)));
+__printf(2, 3)
+void hpfs_error(struct super_block *, const char *, ...);
 int hpfs_stop_cycles(struct super_block *, int, int *, int *, char *);
 unsigned hpfs_count_one_bitmap(struct super_block *, secno);
 
index 255d5e1c03b74197046877181fb1c205c094aafd..3777d138f895b931a7648aea3d7f32896acc3bf5 100644 (file)
@@ -276,10 +276,10 @@ int nilfs_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
 /* super.c */
 extern struct inode *nilfs_alloc_inode(struct super_block *);
 extern void nilfs_destroy_inode(struct inode *);
-extern void nilfs_error(struct super_block *, const char *, const char *, ...)
-       __attribute__ ((format (printf, 3, 4)));
-extern void nilfs_warning(struct super_block *, const char *, const char *, ...)
-       __attribute__ ((format (printf, 3, 4)));
+extern __printf(3, 4)
+void nilfs_error(struct super_block *, const char *, const char *, ...);
+extern __printf(3, 4)
+void nilfs_warning(struct super_block *, const char *, const char *, ...);
 extern struct nilfs_super_block *
 nilfs_read_super_block(struct super_block *, u64, int, struct buffer_head **);
 extern int nilfs_store_magic_and_option(struct super_block *,
index 2142b1c68b618d7de730b26bcf257d7a116e12c1..53c27eaf2307500fc9ec616a3f38c09aea890cc2 100644 (file)
@@ -30,8 +30,9 @@
 
 extern int debug_msgs;
 
-extern void __ntfs_debug(const char *file, int line, const char *function,
-       const char *format, ...) __attribute__ ((format (printf, 4, 5)));
+extern __printf(4, 5)
+void __ntfs_debug(const char *file, int line, const char *function,
+                 const char *format, ...);
 /**
  * ntfs_debug - write a debug level message to syslog
  * @f:         a printf format string containing the message
@@ -52,12 +53,14 @@ extern void ntfs_debug_dump_runlist(const runlist_element *rl);
 
 #endif /* !DEBUG */
 
-extern void __ntfs_warning(const char *function, const struct super_block *sb,
-               const char *fmt, ...) __attribute__ ((format (printf, 3, 4)));
+extern  __printf(3, 4)
+void __ntfs_warning(const char *function, const struct super_block *sb,
+                   const char *fmt, ...);
 #define ntfs_warning(sb, f, a...)      __ntfs_warning(__func__, sb, f, ##a)
 
-extern void __ntfs_error(const char *function, const struct super_block *sb,
-               const char *fmt, ...) __attribute__ ((format (printf, 3, 4)));
+extern  __printf(3, 4)
+void __ntfs_error(const char *function, const struct super_block *sb,
+                 const char *fmt, ...);
 #define ntfs_error(sb, f, a...)                __ntfs_error(__func__, sb, f, ##a)
 
 #endif /* _LINUX_NTFS_DEBUG_H */
index 40c7de084c100cbacd8b7e47b8aa4c4c69737792..74ff74cf78fe9202a110ff353e05163b3ce779d3 100644 (file)
@@ -31,17 +31,15 @@ extern struct workqueue_struct *ocfs2_wq;
 int ocfs2_publish_get_mount_state(struct ocfs2_super *osb,
                                  int node_num);
 
-void __ocfs2_error(struct super_block *sb,
-                  const char *function,
-                  const char *fmt, ...)
-       __attribute__ ((format (printf, 3, 4)));
+__printf(3, 4)
+void __ocfs2_error(struct super_block *sb, const char *function,
+                  const char *fmt, ...);
 
 #define ocfs2_error(sb, fmt, args...) __ocfs2_error(sb, __PRETTY_FUNCTION__, fmt, ##args)
 
-void __ocfs2_abort(struct super_block *sb,
-                  const char *function,
-                  const char *fmt, ...)
-       __attribute__ ((format (printf, 3, 4)));
+__printf(3, 4)
+void __ocfs2_abort(struct super_block *sb, const char *function,
+                  const char *fmt, ...);
 
 #define ocfs2_abort(sb, fmt, args...) __ocfs2_abort(sb, __PRETTY_FUNCTION__, fmt, ##args)
 
index af9fdf04676953b07cb3f13ffcbcee1c5b5ef1ee..8af67234aad38616449b58d09bfda2f51a025654 100644 (file)
 #define ldm_error(f, a...) _ldm_printk (KERN_ERR,   __func__, f, ##a)
 #define ldm_info(f, a...)  _ldm_printk (KERN_INFO,  __func__, f, ##a)
 
-__attribute__ ((format (printf, 3, 4)))
-static void _ldm_printk (const char *level, const char *function,
-                        const char *fmt, ...)
+static __printf(3, 4)
+void _ldm_printk(const char *level, const char *function, const char *fmt, ...)
 {
-       static char buf[128];
+       struct va_format vaf;
        va_list args;
 
        va_start (args, fmt);
-       vsnprintf (buf, sizeof (buf), fmt, args);
-       va_end (args);
 
-       printk ("%s%s(): %s\n", level, function, buf);
+       vaf.fmt = fmt;
+       vaf.va = &args;
+
+       printk("%s%s(): %pV\n", level, function, &vaf);
+
+       va_end (args);
 }
 
 /**
index dbd52d4b5eed9f01382a0be8cddfa2c79f353e0c..4a33c720c34baa9a1331e9b335c49b5699a03027 100644 (file)
@@ -112,8 +112,8 @@ struct extent_position {
 
 /* super.c */
 
-__attribute__((format(printf, 3, 4)))
-extern void udf_warning(struct super_block *, const char *, const char *, ...);
+extern __printf(3, 4)
+void udf_warning(struct super_block *, const char *, const char *, ...);
 static inline void udf_updated_lvid(struct super_block *sb)
 {
        struct buffer_head *bh = UDF_SB(sb)->s_lvid_bh;
index 5be2755dd7152b3f09c325ea8188434d15113821..19d2d1cf6bc1f1223398d2ce43c473db853b8dbd 100644 (file)
@@ -117,9 +117,12 @@ extern int ufs_getfrag_block (struct inode *inode, sector_t fragment, struct buf
 extern const struct file_operations ufs_dir_operations;
 
 /* super.c */
-extern void ufs_warning (struct super_block *, const char *, const char *, ...) __attribute__ ((format (printf, 3, 4)));
-extern void ufs_error (struct super_block *, const char *, const char *, ...) __attribute__ ((format (printf, 3, 4)));
-extern void ufs_panic (struct super_block *, const char *, const char *, ...) __attribute__ ((format (printf, 3, 4)));
+extern __printf(3, 4)
+void ufs_warning (struct super_block *, const char *, const char *, ...);
+extern __printf(3, 4)
+void ufs_error (struct super_block *, const char *, const char *, ...);
+extern __printf(3, 4)
+void ufs_panic (struct super_block *, const char *, const char *, ...);
 
 /* symlink.c */
 extern const struct inode_operations ufs_fast_symlink_inode_operations;
index 7fb7ea007672f04cf59e544363e9a7877b0b9191..56dc0c17f16a6578cade092c3cb553c48a729fc0 100644 (file)
@@ -3,31 +3,29 @@
 
 struct xfs_mount;
 
-extern void xfs_emerg(const struct xfs_mount *mp, const char *fmt, ...)
-        __attribute__ ((format (printf, 2, 3)));
-extern void xfs_alert(const struct xfs_mount *mp, const char *fmt, ...)
-        __attribute__ ((format (printf, 2, 3)));
-extern void xfs_alert_tag(const struct xfs_mount *mp, int tag,
-                        const char *fmt, ...)
-        __attribute__ ((format (printf, 3, 4)));
-extern void xfs_crit(const struct xfs_mount *mp, const char *fmt, ...)
-        __attribute__ ((format (printf, 2, 3)));
-extern void xfs_err(const struct xfs_mount *mp, const char *fmt, ...)
-        __attribute__ ((format (printf, 2, 3)));
-extern void xfs_warn(const struct xfs_mount *mp, const char *fmt, ...)
-        __attribute__ ((format (printf, 2, 3)));
-extern void xfs_notice(const struct xfs_mount *mp, const char *fmt, ...)
-        __attribute__ ((format (printf, 2, 3)));
-extern void xfs_info(const struct xfs_mount *mp, const char *fmt, ...)
-        __attribute__ ((format (printf, 2, 3)));
+extern __printf(2, 3)
+void xfs_emerg(const struct xfs_mount *mp, const char *fmt, ...);
+extern __printf(2, 3)
+void xfs_alert(const struct xfs_mount *mp, const char *fmt, ...);
+extern __printf(3, 4)
+void xfs_alert_tag(const struct xfs_mount *mp, int tag, const char *fmt, ...);
+extern __printf(2, 3)
+void xfs_crit(const struct xfs_mount *mp, const char *fmt, ...);
+extern __printf(2, 3)
+void xfs_err(const struct xfs_mount *mp, const char *fmt, ...);
+extern __printf(2, 3)
+void xfs_warn(const struct xfs_mount *mp, const char *fmt, ...);
+extern __printf(2, 3)
+void xfs_notice(const struct xfs_mount *mp, const char *fmt, ...);
+extern __printf(2, 3)
+void xfs_info(const struct xfs_mount *mp, const char *fmt, ...);
 
 #ifdef DEBUG
-extern void xfs_debug(const struct xfs_mount *mp, const char *fmt, ...)
-        __attribute__ ((format (printf, 2, 3)));
+extern __printf(2, 3)
+void xfs_debug(const struct xfs_mount *mp, const char *fmt, ...);
 #else
-static inline void
-__attribute__ ((format (printf, 2, 3)))
-xfs_debug(const struct xfs_mount *mp, const char *fmt, ...)
+static inline __printf(2, 3)
+void xfs_debug(const struct xfs_mount *mp, const char *fmt, ...)
 {
 }
 #endif
index dfb0ec666c9441d08ab1e81166e27c6a290b56c9..84458b0c38d15f76fc100447a88291b5256a02ae 100644 (file)
@@ -61,11 +61,12 @@ struct bug_entry {
  */
 #ifndef __WARN_TAINT
 #ifndef __ASSEMBLY__
-extern void warn_slowpath_fmt(const char *file, const int line,
-               const char *fmt, ...) __attribute__((format(printf, 3, 4)));
-extern void warn_slowpath_fmt_taint(const char *file, const int line,
-                                   unsigned taint, const char *fmt, ...)
-       __attribute__((format(printf, 4, 5)));
+extern __printf(3, 4)
+void warn_slowpath_fmt(const char *file, const int line,
+                      const char *fmt, ...);
+extern __printf(4, 5)
+void warn_slowpath_fmt_taint(const char *file, const int line, unsigned taint,
+                            const char *fmt, ...);
 extern void warn_slowpath_null(const char *file, const int line);
 #define WANT_WARN_ON_SLOWPATH
 #endif
index 7e447f8415fcb67f505d1746bc57b1ec320dbc1c..36ac94464daca894975470d42126f92e109cae38 100644 (file)
@@ -123,12 +123,12 @@ struct drm_device;
  * using the DRM_DEBUG_KMS and DRM_DEBUG.
  */
 
-extern __attribute__((format (printf, 4, 5)))
+extern __printf(4, 5)
 void drm_ut_debug_printk(unsigned int request_level,
-                               const char *prefix,
-                               const char *function_name,
-                               const char *format, ...);
-extern __attribute__((format (printf, 2, 3)))
+                        const char *prefix,
+                        const char *function_name,
+                        const char *format, ...);
+extern __printf(2, 3)
 int drm_err(const char *func, const char *format, ...);
 
 /***********************************************************************/
index 0c8006129fb2795195443eee29f1b8a84d511652..2f81c6f3b630d74e38240e1b9415d3635b0e358f 100644 (file)
@@ -584,14 +584,13 @@ extern int audit_signals;
 #ifdef CONFIG_AUDIT
 /* These are defined in audit.c */
                                /* Public API */
-extern void                audit_log(struct audit_context *ctx, gfp_t gfp_mask,
-                                     int type, const char *fmt, ...)
-                                     __attribute__((format(printf,4,5)));
+extern __printf(4, 5)
+void audit_log(struct audit_context *ctx, gfp_t gfp_mask, int type,
+              const char *fmt, ...);
 
 extern struct audit_buffer *audit_log_start(struct audit_context *ctx, gfp_t gfp_mask, int type);
-extern void                audit_log_format(struct audit_buffer *ab,
-                                            const char *fmt, ...)
-                           __attribute__((format(printf,2,3)));
+extern __printf(2, 3)
+void audit_log_format(struct audit_buffer *ab, const char *fmt, ...);
 extern void                audit_log_end(struct audit_buffer *ab);
 extern int                 audit_string_contains_control(const char *string,
                                                          size_t len);
index 8e9e4bc6d73b4b5351748afca97a2b4a43b66654..4d1a0748eaf8721c0cd4a34c0baf29ce455fc2d2 100644 (file)
@@ -170,7 +170,7 @@ extern void blk_trace_shutdown(struct request_queue *);
 extern int do_blk_trace_setup(struct request_queue *q, char *name,
                              dev_t dev, struct block_device *bdev,
                              struct blk_user_trace_setup *buts);
-extern __attribute__((format(printf, 2, 3)))
+extern __printf(2, 3)
 void __trace_note_message(struct blk_trace *, const char *fmt, ...);
 
 /**
index f823cfb79ef64ebf8299762f99383d81b17861d1..8bab5c402761954e83ac7c77c45ec6bda00888ea 100644 (file)
@@ -621,8 +621,8 @@ static inline const char *dev_name(const struct device *dev)
        return kobject_name(&dev->kobj);
 }
 
-extern int dev_set_name(struct device *dev, const char *name, ...)
-                       __attribute__((format(printf, 2, 3)));
+extern __printf(2, 3)
+int dev_set_name(struct device *dev, const char *name, ...);
 
 #ifdef CONFIG_NUMA
 static inline int dev_to_node(struct device *dev)
@@ -756,10 +756,10 @@ extern struct device *device_create_vargs(struct class *cls,
                                          void *drvdata,
                                          const char *fmt,
                                          va_list vargs);
-extern struct device *device_create(struct class *cls, struct device *parent,
-                                   dev_t devt, void *drvdata,
-                                   const char *fmt, ...)
-                                   __attribute__((format(printf, 5, 6)));
+extern __printf(5, 6)
+struct device *device_create(struct class *cls, struct device *parent,
+                            dev_t devt, void *drvdata,
+                            const char *fmt, ...);
 extern void device_destroy(struct class *cls, dev_t devt);
 
 /*
@@ -803,64 +803,56 @@ extern const char *dev_driver_string(const struct device *dev);
 
 extern int __dev_printk(const char *level, const struct device *dev,
                        struct va_format *vaf);
-extern int dev_printk(const char *level, const struct device *dev,
-                     const char *fmt, ...)
-       __attribute__ ((format (printf, 3, 4)));
-extern int dev_emerg(const struct device *dev, const char *fmt, ...)
-       __attribute__ ((format (printf, 2, 3)));
-extern int dev_alert(const struct device *dev, const char *fmt, ...)
-       __attribute__ ((format (printf, 2, 3)));
-extern int dev_crit(const struct device *dev, const char *fmt, ...)
-       __attribute__ ((format (printf, 2, 3)));
-extern int dev_err(const struct device *dev, const char *fmt, ...)
-       __attribute__ ((format (printf, 2, 3)));
-extern int dev_warn(const struct device *dev, const char *fmt, ...)
-       __attribute__ ((format (printf, 2, 3)));
-extern int dev_notice(const struct device *dev, const char *fmt, ...)
-       __attribute__ ((format (printf, 2, 3)));
-extern int _dev_info(const struct device *dev, const char *fmt, ...)
-       __attribute__ ((format (printf, 2, 3)));
+extern __printf(3, 4)
+int dev_printk(const char *level, const struct device *dev,
+              const char *fmt, ...)
+       ;
+extern __printf(2, 3)
+int dev_emerg(const struct device *dev, const char *fmt, ...);
+extern __printf(2, 3)
+int dev_alert(const struct device *dev, const char *fmt, ...);
+extern __printf(2, 3)
+int dev_crit(const struct device *dev, const char *fmt, ...);
+extern __printf(2, 3)
+int dev_err(const struct device *dev, const char *fmt, ...);
+extern __printf(2, 3)
+int dev_warn(const struct device *dev, const char *fmt, ...);
+extern __printf(2, 3)
+int dev_notice(const struct device *dev, const char *fmt, ...);
+extern __printf(2, 3)
+int _dev_info(const struct device *dev, const char *fmt, ...);
 
 #else
 
 static inline int __dev_printk(const char *level, const struct device *dev,
                               struct va_format *vaf)
-        { return 0; }
-static inline int dev_printk(const char *level, const struct device *dev,
-                     const char *fmt, ...)
-       __attribute__ ((format (printf, 3, 4)));
-static inline int dev_printk(const char *level, const struct device *dev,
-                     const char *fmt, ...)
-        { return 0; }
-
-static inline int dev_emerg(const struct device *dev, const char *fmt, ...)
-       __attribute__ ((format (printf, 2, 3)));
-static inline int dev_emerg(const struct device *dev, const char *fmt, ...)
-       { return 0; }
-static inline int dev_crit(const struct device *dev, const char *fmt, ...)
-       __attribute__ ((format (printf, 2, 3)));
-static inline int dev_crit(const struct device *dev, const char *fmt, ...)
-       { return 0; }
-static inline int dev_alert(const struct device *dev, const char *fmt, ...)
-       __attribute__ ((format (printf, 2, 3)));
-static inline int dev_alert(const struct device *dev, const char *fmt, ...)
-       { return 0; }
-static inline int dev_err(const struct device *dev, const char *fmt, ...)
-       __attribute__ ((format (printf, 2, 3)));
-static inline int dev_err(const struct device *dev, const char *fmt, ...)
-       { return 0; }
-static inline int dev_warn(const struct device *dev, const char *fmt, ...)
-       __attribute__ ((format (printf, 2, 3)));
-static inline int dev_warn(const struct device *dev, const char *fmt, ...)
-       { return 0; }
-static inline int dev_notice(const struct device *dev, const char *fmt, ...)
-       __attribute__ ((format (printf, 2, 3)));
-static inline int dev_notice(const struct device *dev, const char *fmt, ...)
-       { return 0; }
-static inline int _dev_info(const struct device *dev, const char *fmt, ...)
-       __attribute__ ((format (printf, 2, 3)));
-static inline int _dev_info(const struct device *dev, const char *fmt, ...)
-       { return 0; }
+{ return 0; }
+static inline __printf(3, 4)
+int dev_printk(const char *level, const struct device *dev,
+              const char *fmt, ...)
+{ return 0; }
+
+static inline __printf(2, 3)
+int dev_emerg(const struct device *dev, const char *fmt, ...)
+{ return 0; }
+static inline __printf(2, 3)
+int dev_crit(const struct device *dev, const char *fmt, ...)
+{ return 0; }
+static inline __printf(2, 3)
+int dev_alert(const struct device *dev, const char *fmt, ...)
+{ return 0; }
+static inline __printf(2, 3)
+int dev_err(const struct device *dev, const char *fmt, ...)
+{ return 0; }
+static inline __printf(2, 3)
+int dev_warn(const struct device *dev, const char *fmt, ...)
+{ return 0; }
+static inline __printf(2, 3)
+int dev_notice(const struct device *dev, const char *fmt, ...)
+{ return 0; }
+static inline __printf(2, 3)
+int _dev_info(const struct device *dev, const char *fmt, ...)
+{ return 0; }
 
 #endif
 
index 13aae8087b560b7a487489afac198e4b4ef9dae1..0564e3c39882fc20e7e4c3e08d8ea2840d32302d 100644 (file)
@@ -37,22 +37,21 @@ int ddebug_add_module(struct _ddebug *tab, unsigned int n,
 
 #if defined(CONFIG_DYNAMIC_DEBUG)
 extern int ddebug_remove_module(const char *mod_name);
-extern int __dynamic_pr_debug(struct _ddebug *descriptor, const char *fmt, ...)
-       __attribute__ ((format (printf, 2, 3)));
+extern __printf(2, 3)
+int __dynamic_pr_debug(struct _ddebug *descriptor, const char *fmt, ...);
 
 struct device;
 
-extern int __dynamic_dev_dbg(struct _ddebug *descriptor,
-                            const struct device *dev,
-                            const char *fmt, ...)
-       __attribute__ ((format (printf, 3, 4)));
+extern __printf(3, 4)
+int __dynamic_dev_dbg(struct _ddebug *descriptor, const struct device *dev,
+                     const char *fmt, ...);
 
 struct net_device;
 
-extern int __dynamic_netdev_dbg(struct _ddebug *descriptor,
-                            const struct net_device *dev,
-                            const char *fmt, ...)
-       __attribute__ ((format (printf, 3, 4)));
+extern __printf(3, 4)
+int __dynamic_netdev_dbg(struct _ddebug *descriptor,
+                        const struct net_device *dev,
+                        const char *fmt, ...);
 
 #define DEFINE_DYNAMIC_DEBUG_METADATA(name, fmt)               \
        static struct _ddebug __used __aligned(8)               \
index 0244611eb2b836b6a2f5434a1fc8c966bc15e25b..8196763a3863e887e73bd07817eb354c62824605 100644 (file)
@@ -937,15 +937,15 @@ extern int ext3_group_extend(struct super_block *sb,
                                ext3_fsblk_t n_blocks_count);
 
 /* super.c */
-extern void ext3_error (struct super_block *, const char *, const char *, ...)
-       __attribute__ ((format (printf, 3, 4)));
+extern __printf(3, 4)
+void ext3_error (struct super_block *, const char *, const char *, ...);
 extern void __ext3_std_error (struct super_block *, const char *, int);
-extern void ext3_abort (struct super_block *, const char *, const char *, ...)
-       __attribute__ ((format (printf, 3, 4)));
-extern void ext3_warning (struct super_block *, const char *, const char *, ...)
-       __attribute__ ((format (printf, 3, 4)));
-extern void ext3_msg(struct super_block *, const char *, const char *, ...)
-       __attribute__ ((format (printf, 3, 4)));
+extern __printf(3, 4)
+void ext3_abort (struct super_block *, const char *, const char *, ...);
+extern __printf(3, 4)
+void ext3_warning (struct super_block *, const char *, const char *, ...);
+extern __printf(3, 4)
+void ext3_msg(struct super_block *, const char *, const char *, ...);
 extern void ext3_update_dynamic_rev (struct super_block *sb);
 
 #define ext3_std_error(sb, errno)                              \
index e005f34d4da87c682f08efe1c0af800d303649f4..0340a201fcf839bb3d849784b8be082b48fe5690 100644 (file)
@@ -2629,8 +2629,8 @@ static const struct file_operations __fops = {                            \
        .llseek  = generic_file_llseek,                                 \
 };
 
-static inline void __attribute__((format(printf, 1, 2)))
-__simple_attr_check_format(const char *fmt, ...)
+static inline __printf(1, 2)
+void __simple_attr_check_format(const char *fmt, ...)
 {
        /* don't do anything, just let the compiler check the arguments; */
 }
index af095b54502e35471cad25d0e74e042fb50ecc4f..ce31408b1e47d6e6cfb81ad25a3ca0fdaefaef84 100644 (file)
@@ -492,10 +492,10 @@ static inline void fscache_end_io(struct fscache_retrieval *op,
 /*
  * out-of-line cache backend functions
  */
-extern void fscache_init_cache(struct fscache_cache *cache,
-                              const struct fscache_cache_ops *ops,
-                              const char *idfmt,
-                              ...) __attribute__ ((format (printf, 3, 4)));
+extern __printf(3, 4)
+void fscache_init_cache(struct fscache_cache *cache,
+                       const struct fscache_cache_ops *ops,
+                       const char *idfmt, ...);
 
 extern int fscache_add_cache(struct fscache_cache *cache,
                             struct fscache_object *fsdef,
index e74073e9dd8d2be42cd1e90df38479fbb649dc20..b456b08d70ed4bd68aa77ef511b8cc9b05851d97 100644 (file)
@@ -77,8 +77,8 @@ void __gameport_register_port(struct gameport *gameport, struct module *owner);
 
 void gameport_unregister_port(struct gameport *gameport);
 
-void gameport_set_phys(struct gameport *gameport, const char *fmt, ...)
-       __attribute__ ((format (printf, 2, 3)));
+__printf(2, 3)
+void gameport_set_phys(struct gameport *gameport, const char *fmt, ...);
 
 #else
 
@@ -92,8 +92,8 @@ static inline void gameport_unregister_port(struct gameport *gameport)
        return;
 }
 
-static inline void gameport_set_phys(struct gameport *gameport,
-                                    const char *fmt, ...)
+static inline __printf(2, 3)
+void gameport_set_phys(struct gameport *gameport, const char *fmt, ...)
 {
        return;
 }
index 0df513b7a9f8670674a491338852d9a5570f5186..387571959dd9a1219c90dc952c29f8382698f397 100644 (file)
@@ -101,9 +101,8 @@ static inline int lookup_symbol_attrs(unsigned long addr, unsigned long *size, u
 #endif /*CONFIG_KALLSYMS*/
 
 /* This macro allows us to keep printk typechecking */
-static void __check_printsym_format(const char *fmt, ...)
-__attribute__((format(printf,1,2)));
-static inline void __check_printsym_format(const char *fmt, ...)
+static __printf(1, 2)
+void __check_printsym_format(const char *fmt, ...)
 {
 }
 
index 529d9a0c75a5bb26249f2d766800e58a1b1440da..064725854db8c7eff3c5a38a093aec190a6c6c7f 100644 (file)
@@ -114,12 +114,9 @@ typedef enum {
 } kdb_reason_t;
 
 extern int kdb_trap_printk;
-extern int vkdb_printf(const char *fmt, va_list args)
-           __attribute__ ((format (printf, 1, 0)));
-extern int kdb_printf(const char *, ...)
-           __attribute__ ((format (printf, 1, 2)));
-typedef int (*kdb_printf_t)(const char *, ...)
-            __attribute__ ((format (printf, 1, 2)));
+extern __printf(1, 0) int vkdb_printf(const char *fmt, va_list args);
+extern __printf(1, 2) int kdb_printf(const char *, ...);
+typedef __printf(1, 2) int (*kdb_printf_t)(const char *, ...);
 
 extern void kdb_init(int level);
 
index 8eefcf7e95eb18cabef6066498a7f9ca55cf521f..3f8a419ccfe651dd32cfdf3d0b19d184aefde94f 100644 (file)
@@ -296,20 +296,18 @@ extern long long simple_strtoll(const char *,char **,unsigned int);
 #define strict_strtoull        kstrtoull
 #define strict_strtoll kstrtoll
 
-extern int sprintf(char * buf, const char * fmt, ...)
-       __attribute__ ((format (printf, 2, 3)));
-extern int vsprintf(char *buf, const char *, va_list)
-       __attribute__ ((format (printf, 2, 0)));
-extern int snprintf(char * buf, size_t size, const char * fmt, ...)
-       __attribute__ ((format (printf, 3, 4)));
-extern int vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
-       __attribute__ ((format (printf, 3, 0)));
-extern int scnprintf(char * buf, size_t size, const char * fmt, ...)
-       __attribute__ ((format (printf, 3, 4)));
-extern int vscnprintf(char *buf, size_t size, const char *fmt, va_list args)
-       __attribute__ ((format (printf, 3, 0)));
-extern char *kasprintf(gfp_t gfp, const char *fmt, ...)
-       __attribute__ ((format (printf, 2, 3)));
+extern __printf(2, 3) int sprintf(char * buf, const char * fmt, ...);
+extern __printf(2, 0) int vsprintf(char *buf, const char *, va_list);
+extern __printf(3, 4)
+int snprintf(char * buf, size_t size, const char * fmt, ...);
+extern __printf(3, 0)
+int vsnprintf(char *buf, size_t size, const char *fmt, va_list args);
+extern __printf(3, 4)
+int scnprintf(char * buf, size_t size, const char * fmt, ...);
+extern __printf(3, 0)
+int vscnprintf(char *buf, size_t size, const char *fmt, va_list args);
+extern __printf(2, 3)
+char *kasprintf(gfp_t gfp, const char *fmt, ...);
 extern char *kvasprintf(gfp_t gfp, const char *fmt, va_list args);
 
 extern int sscanf(const char *, const char *, ...)
@@ -427,8 +425,8 @@ extern void tracing_start(void);
 extern void tracing_stop(void);
 extern void ftrace_off_permanent(void);
 
-static inline void __attribute__ ((format (printf, 1, 2)))
-____trace_printk_check_format(const char *fmt, ...)
+static inline __printf(1, 2)
+void ____trace_printk_check_format(const char *fmt, ...)
 {
 }
 #define __trace_printk_check_format(fmt, args...)                      \
@@ -467,13 +465,11 @@ do {                                                                      \
                __trace_printk(_THIS_IP_, fmt, ##args);         \
 } while (0)
 
-extern int
-__trace_bprintk(unsigned long ip, const char *fmt, ...)
-       __attribute__ ((format (printf, 2, 3)));
+extern __printf(2, 3)
+int __trace_bprintk(unsigned long ip, const char *fmt, ...);
 
-extern int
-__trace_printk(unsigned long ip, const char *fmt, ...)
-       __attribute__ ((format (printf, 2, 3)));
+extern __printf(2, 3)
+int __trace_printk(unsigned long ip, const char *fmt, ...);
 
 extern void trace_dump_stack(void);
 
@@ -502,8 +498,8 @@ __ftrace_vprintk(unsigned long ip, const char *fmt, va_list ap);
 
 extern void ftrace_dump(enum ftrace_dump_mode oops_dump_mode);
 #else
-static inline int
-trace_printk(const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
+static inline __printf(1, 2)
+int trace_printk(const char *fmt, ...);
 
 static inline void tracing_start(void) { }
 static inline void tracing_stop(void) { }
index fe45136b32cc78ff62651956f5157cd98ee3cb0e..2fa0901219d4b7fe69158689e08b33db5ac69db1 100644 (file)
@@ -140,8 +140,8 @@ void crash_save_vmcoreinfo(void);
 void crash_map_reserved_pages(void);
 void crash_unmap_reserved_pages(void);
 void arch_crash_save_vmcoreinfo(void);
-void vmcoreinfo_append_str(const char *fmt, ...)
-       __attribute__ ((format (printf, 1, 2)));
+__printf(1, 2)
+void vmcoreinfo_append_str(const char *fmt, ...);
 unsigned long paddr_vmcoreinfo_note(void);
 
 #define VMCOREINFO_OSRELEASE(value) \
index 0da38cf7db7bddc8841d14620a9e831866afcfd2..b16f6539073432ca9b206ac0be6531854942363c 100644 (file)
@@ -32,8 +32,8 @@
 extern char modprobe_path[]; /* for sysctl */
 /* modprobe exit status on success, -ve on error.  Return value
  * usually useless though. */
-extern int __request_module(bool wait, const char *name, ...) \
-       __attribute__((format(printf, 2, 3)));
+extern __printf(2, 3)
+int __request_module(bool wait, const char *name, ...);
 #define request_module(mod...) __request_module(true, mod)
 #define request_module_nowait(mod...) __request_module(false, mod)
 #define try_then_request_module(x, mod...) \
index 668729cc0fe9d4774c78797a521a67d97cdd2b69..ad81e1c51487def091ffea196d36c1ee005f7698 100644 (file)
@@ -72,8 +72,8 @@ struct kobject {
        unsigned int uevent_suppress:1;
 };
 
-extern int kobject_set_name(struct kobject *kobj, const char *name, ...)
-                           __attribute__((format(printf, 2, 3)));
+extern __printf(2, 3)
+int kobject_set_name(struct kobject *kobj, const char *name, ...);
 extern int kobject_set_name_vargs(struct kobject *kobj, const char *fmt,
                                  va_list vargs);
 
@@ -83,15 +83,13 @@ static inline const char *kobject_name(const struct kobject *kobj)
 }
 
 extern void kobject_init(struct kobject *kobj, struct kobj_type *ktype);
-extern int __must_check kobject_add(struct kobject *kobj,
-                                   struct kobject *parent,
-                                   const char *fmt, ...)
-       __attribute__((format(printf, 3, 4)));
-extern int __must_check kobject_init_and_add(struct kobject *kobj,
-                                            struct kobj_type *ktype,
-                                            struct kobject *parent,
-                                            const char *fmt, ...)
-       __attribute__((format(printf, 4, 5)));
+extern __printf(3, 4) __must_check
+int kobject_add(struct kobject *kobj, struct kobject *parent,
+               const char *fmt, ...);
+extern __printf(4, 5) __must_check
+int kobject_init_and_add(struct kobject *kobj,
+                        struct kobj_type *ktype, struct kobject *parent,
+                        const char *fmt, ...);
 
 extern void kobject_del(struct kobject *kobj);
 
@@ -212,8 +210,8 @@ int kobject_uevent(struct kobject *kobj, enum kobject_action action);
 int kobject_uevent_env(struct kobject *kobj, enum kobject_action action,
                        char *envp[]);
 
-int add_uevent_var(struct kobj_uevent_env *env, const char *format, ...)
-       __attribute__((format (printf, 2, 3)));
+__printf(2, 3)
+int add_uevent_var(struct kobj_uevent_env *env, const char *format, ...);
 
 int kobject_action_type(const char *buf, size_t count,
                        enum kobject_action *type);
@@ -226,7 +224,7 @@ static inline int kobject_uevent_env(struct kobject *kobj,
                                      char *envp[])
 { return 0; }
 
-static inline __attribute__((format(printf, 2, 3)))
+static inline __printf(2, 3)
 int add_uevent_var(struct kobj_uevent_env *env, const char *format, ...)
 { return 0; }
 
index 1e923e5e88e81cdc83c8455eefb776eb1b5de588..5cac19b3a26676adad682d1a5cc06d080dbd2885 100644 (file)
@@ -4,11 +4,11 @@
 #include <linux/err.h>
 #include <linux/sched.h>
 
+__printf(4, 5)
 struct task_struct *kthread_create_on_node(int (*threadfn)(void *data),
                                           void *data,
                                           int node,
-                                          const char namefmt[], ...)
-       __attribute__((format(printf, 4, 5)));
+                                          const char namefmt[], ...);
 
 #define kthread_create(threadfn, data, namefmt, arg...) \
        kthread_create_on_node(threadfn, data, -1, namefmt, ##arg)
index 23fa829bf7a369c59262fd9fae9c8949dbabd9b9..cafc09a64fe43636cbc1cf9f16366eb5c3e9ef06 100644 (file)
@@ -1256,13 +1256,13 @@ static inline int sata_srst_pmp(struct ata_link *link)
 /*
  * printk helpers
  */
-__attribute__((format (printf, 3, 4)))
+__printf(3, 4)
 int ata_port_printk(const struct ata_port *ap, const char *level,
                    const char *fmt, ...);
-__attribute__((format (printf, 3, 4)))
+__printf(3, 4)
 int ata_link_printk(const struct ata_link *link, const char *level,
                    const char *fmt, ...);
-__attribute__((format (printf, 3, 4)))
+__printf(3, 4)
 int ata_dev_printk(const struct ata_device *dev, const char *level,
                   const char *fmt, ...);
 
@@ -1304,10 +1304,10 @@ void ata_print_version(const struct device *dev, const char *version);
 /*
  * ata_eh_info helpers
  */
-extern void __ata_ehi_push_desc(struct ata_eh_info *ehi, const char *fmt, ...)
-       __attribute__ ((format (printf, 2, 3)));
-extern void ata_ehi_push_desc(struct ata_eh_info *ehi, const char *fmt, ...)
-       __attribute__ ((format (printf, 2, 3)));
+extern __printf(2, 3)
+void __ata_ehi_push_desc(struct ata_eh_info *ehi, const char *fmt, ...);
+extern __printf(2, 3)
+void ata_ehi_push_desc(struct ata_eh_info *ehi, const char *fmt, ...);
 extern void ata_ehi_clear_desc(struct ata_eh_info *ehi);
 
 static inline void ata_ehi_hotplugged(struct ata_eh_info *ehi)
@@ -1321,8 +1321,8 @@ static inline void ata_ehi_hotplugged(struct ata_eh_info *ehi)
 /*
  * port description helpers
  */
-extern void ata_port_desc(struct ata_port *ap, const char *fmt, ...)
-       __attribute__ ((format (printf, 2, 3)));
+extern __printf(2, 3)
+void ata_port_desc(struct ata_port *ap, const char *fmt, ...);
 #ifdef CONFIG_PCI
 extern void ata_port_pbar_desc(struct ata_port *ap, int bar, ssize_t offset,
                               const char *name);
index 97491f78b08cd72138ed25750145275ca1dabb90..c5d52780d6a02fe27ec67cb892b447c43a6beefb 100644 (file)
@@ -49,8 +49,7 @@ extern void mmiotrace_ioremap(resource_size_t offset, unsigned long size,
 extern void mmiotrace_iounmap(volatile void __iomem *addr);
 
 /* For anyone to insert markers. Remember trailing newline. */
-extern int mmiotrace_printk(const char *fmt, ...)
-                               __attribute__ ((format (printf, 1, 2)));
+extern __printf(1, 2) int mmiotrace_printk(const char *fmt, ...);
 #else /* !CONFIG_MMIOTRACE: */
 static inline int is_kmmio_active(void)
 {
@@ -71,10 +70,7 @@ static inline void mmiotrace_iounmap(volatile void __iomem *addr)
 {
 }
 
-static inline int mmiotrace_printk(const char *fmt, ...)
-                               __attribute__ ((format (printf, 1, 0)));
-
-static inline int mmiotrace_printk(const char *fmt, ...)
+static inline __printf(1, 2) int mmiotrace_printk(const char *fmt, ...)
 {
        return 0;
 }
index 4d4471eb88e368994c6eb09ab020aac1d8a1bfc8..38793c8b8a74263b9da6ae2be73c9a3b5e6e9c44 100644 (file)
@@ -2619,23 +2619,23 @@ static inline const char *netdev_name(const struct net_device *dev)
 extern int __netdev_printk(const char *level, const struct net_device *dev,
                        struct va_format *vaf);
 
-extern int netdev_printk(const char *level, const struct net_device *dev,
-                        const char *format, ...)
-       __attribute__ ((format (printf, 3, 4)));
-extern int netdev_emerg(const struct net_device *dev, const char *format, ...)
-       __attribute__ ((format (printf, 2, 3)));
-extern int netdev_alert(const struct net_device *dev, const char *format, ...)
-       __attribute__ ((format (printf, 2, 3)));
-extern int netdev_crit(const struct net_device *dev, const char *format, ...)
-       __attribute__ ((format (printf, 2, 3)));
-extern int netdev_err(const struct net_device *dev, const char *format, ...)
-       __attribute__ ((format (printf, 2, 3)));
-extern int netdev_warn(const struct net_device *dev, const char *format, ...)
-       __attribute__ ((format (printf, 2, 3)));
-extern int netdev_notice(const struct net_device *dev, const char *format, ...)
-       __attribute__ ((format (printf, 2, 3)));
-extern int netdev_info(const struct net_device *dev, const char *format, ...)
-       __attribute__ ((format (printf, 2, 3)));
+extern __printf(3, 4)
+int netdev_printk(const char *level, const struct net_device *dev,
+                 const char *format, ...);
+extern __printf(2, 3)
+int netdev_emerg(const struct net_device *dev, const char *format, ...);
+extern __printf(2, 3)
+int netdev_alert(const struct net_device *dev, const char *format, ...);
+extern __printf(2, 3)
+int netdev_crit(const struct net_device *dev, const char *format, ...);
+extern __printf(2, 3)
+int netdev_err(const struct net_device *dev, const char *format, ...);
+extern __printf(2, 3)
+int netdev_warn(const struct net_device *dev, const char *format, ...);
+extern __printf(2, 3)
+int netdev_notice(const struct net_device *dev, const char *format, ...);
+extern __printf(2, 3)
+int netdev_info(const struct net_device *dev, const char *format, ...);
 
 #define MODULE_ALIAS_NETDEV(device) \
        MODULE_ALIAS("netdev-" device)
index 0101d55d9651f3cc1dc48858ba0ca1b301ec6425..f0e22f75143f67e3b4d8dc72ba4bc8e81e3a5570 100644 (file)
@@ -82,22 +82,22 @@ struct va_format {
  * Dummy printk for disabled debugging statements to use whilst maintaining
  * gcc's format and side-effect checking.
  */
-static inline __attribute__ ((format (printf, 1, 2)))
+static inline __printf(1, 2)
 int no_printk(const char *fmt, ...)
 {
        return 0;
 }
 
-extern asmlinkage __attribute__ ((format (printf, 1, 2)))
+extern asmlinkage __printf(1, 2)
 void early_printk(const char *fmt, ...);
 
 extern int printk_needs_cpu(int cpu);
 extern void printk_tick(void);
 
 #ifdef CONFIG_PRINTK
-asmlinkage __attribute__ ((format (printf, 1, 0)))
+asmlinkage __printf(1, 0)
 int vprintk(const char *fmt, va_list args);
-asmlinkage __attribute__ ((format (printf, 1, 2))) __cold
+asmlinkage __printf(1, 2) __cold
 int printk(const char *fmt, ...);
 
 /*
@@ -117,12 +117,12 @@ extern int kptr_restrict;
 void log_buf_kexec_setup(void);
 void __init setup_log_buf(int early);
 #else
-static inline __attribute__ ((format (printf, 1, 0)))
+static inline __printf(1, 0)
 int vprintk(const char *s, va_list args)
 {
        return 0;
 }
-static inline __attribute__ ((format (printf, 1, 2))) __cold
+static inline __printf(1, 2) __cold
 int printk(const char *s, ...)
 {
        return 0;
index 26f9e3612e0f6618e8d15285db9b354d63ffbb96..d93f95e6177ce4bc583538f1dfb3366fe9f9b322 100644 (file)
@@ -31,7 +31,7 @@ static inline bool is_quota_modification(struct inode *inode, struct iattr *ia)
 #define quota_error(sb, fmt, args...) \
        __quota_error((sb), __func__, fmt , ## args)
 
-extern __attribute__((format (printf, 3, 4)))
+extern __printf(3, 4)
 void __quota_error(struct super_block *sb, const char *func,
                   const char *fmt, ...);
 
index be720cd2038d3704d30d9f183798be084936c914..0b69a46842160770807197b7470075bf6ae16bde 100644 (file)
@@ -84,8 +84,7 @@ int seq_putc(struct seq_file *m, char c);
 int seq_puts(struct seq_file *m, const char *s);
 int seq_write(struct seq_file *seq, const void *data, size_t len);
 
-int seq_printf(struct seq_file *, const char *, ...)
-       __attribute__ ((format (printf,2,3)));
+__printf(2, 3) int seq_printf(struct seq_file *, const char *, ...);
 
 int seq_path(struct seq_file *, struct path *, char *);
 int seq_dentry(struct seq_file *, struct dentry *, char *);
index 5cf397ceb726fee2c48da416f8ade27c1ae6a7f5..7dadc3df0c77da531483d17210589b8294f5bc8f 100644 (file)
@@ -29,10 +29,10 @@ trace_seq_init(struct trace_seq *s)
  * Currently only defined when tracing is enabled.
  */
 #ifdef CONFIG_TRACING
-extern int trace_seq_printf(struct trace_seq *s, const char *fmt, ...)
-       __attribute__ ((format (printf, 2, 3)));
-extern int trace_seq_vprintf(struct trace_seq *s, const char *fmt, va_list args)
-       __attribute__ ((format (printf, 2, 0)));
+extern __printf(2, 3)
+int trace_seq_printf(struct trace_seq *s, const char *fmt, ...);
+extern __printf(2, 0)
+int trace_seq_vprintf(struct trace_seq *s, const char *fmt, va_list args);
 extern int
 trace_seq_bprintf(struct trace_seq *s, const char *fmt, const u32 *binary);
 extern int trace_print_seq(struct seq_file *m, struct trace_seq *s);
index e727555d4ee9bc479df54d32fc5b9e6ce9ac52cd..e86af08293a8217153b48a98a4802015376185db 100644 (file)
@@ -77,7 +77,7 @@ struct bt_power {
 #define BT_POWER_FORCE_ACTIVE_OFF 0
 #define BT_POWER_FORCE_ACTIVE_ON  1
 
-__attribute__((format (printf, 2, 3)))
+__printf(2, 3)
 int bt_printk(const char *level, const char *fmt, ...);
 
 #define BT_INFO(fmt, arg...)   bt_printk(KERN_INFO, pr_fmt(fmt), ##arg)
index 920997f1aff0ff11868f78fcd2bc5f31f41905d5..e991bd0a27afcaa87c4afcb5622188b9b5070f30 100644 (file)
@@ -53,12 +53,13 @@ int nf_log_bind_pf(u_int8_t pf, const struct nf_logger *logger);
 void nf_log_unbind_pf(u_int8_t pf);
 
 /* Calls the registered backend logging function */
+__printf(7, 8)
 void nf_log_packet(u_int8_t pf,
                   unsigned int hooknum,
                   const struct sk_buff *skb,
                   const struct net_device *in,
                   const struct net_device *out,
                   const struct nf_loginfo *li,
-                  const char *fmt, ...) __attribute__ ((format(printf,7,8)));
+                  const char *fmt, ...);
 
 #endif /* _NF_LOG_H */
index beb1a911acbbc3d07cd3b93799fcf3201d25d70e..abb6e0f0c3c3e59b79f23fc72d2e9d8d389e3774 100644 (file)
@@ -75,8 +75,8 @@
                                        printk(KERN_DEBUG msg); } while (0)
 #else
 /* Validate arguments and do nothing */
-static inline void __attribute__ ((format (printf, 2, 3)))
-SOCK_DEBUG(struct sock *sk, const char *msg, ...)
+static inline __printf(2, 3)
+void SOCK_DEBUG(struct sock *sk, const char *msg, ...)
 {
 }
 #endif
index a91d78eb2f07afaa51eb62dc58d116b710fa12af..3be5ab782b99c74d6f0a1326eaf28f6108dfa708 100644 (file)
@@ -326,9 +326,9 @@ void release_and_free_resource(struct resource *res);
 /* --- */
 
 #if defined(CONFIG_SND_DEBUG) || defined(CONFIG_SND_VERBOSE_PRINTK)
+__printf(4, 5)
 void __snd_printk(unsigned int level, const char *file, int line,
-                 const char *format, ...)
-     __attribute__ ((format (printf, 4, 5)));
+                 const char *format, ...);
 #else
 #define __snd_printk(level, file, line, format, args...) \
        printk(format, ##args)
index 4e94cf1ff7621c65b83560eb5eb9fc428b23fef0..5492cc40dc575f07fc55028febe883d522d00bb3 100644 (file)
@@ -110,8 +110,8 @@ void snd_card_info_read_oss(struct snd_info_buffer *buffer);
 static inline void snd_card_info_read_oss(struct snd_info_buffer *buffer) {}
 #endif
 
-int snd_iprintf(struct snd_info_buffer *buffer, const char *fmt, ...) \
-                               __attribute__ ((format (printf, 2, 3)));
+__printf(2, 3)
+int snd_iprintf(struct snd_info_buffer *buffer, const char *fmt, ...);
 int snd_info_init(void);
 int snd_info_done(void);
 
index 3d9afb6a8c9cd86b5ead0d9ccccaa49614f47fd8..f352a98ce4f41927d7ec201a0336fee624fb008c 100644 (file)
@@ -75,9 +75,9 @@ struct snd_seq_port_callback {
 };
 
 /* interface for kernel client */
+__printf(3, 4)
 int snd_seq_create_kernel_client(struct snd_card *card, int client_index,
-                                const char *name_fmt, ...)
-       __attribute__ ((format (printf, 3, 4)));
+                                const char *name_fmt, ...);
 int snd_seq_delete_kernel_client(int client);
 int snd_seq_kernel_client_enqueue(int client, struct snd_seq_event *ev, int atomic, int hop);
 int snd_seq_kernel_client_dispatch(int client, struct snd_seq_event *ev, int atomic, int hop);
index 901724dc528d35f9b28f8376b791da4f8e1613e1..b62dfef15f61ad8d0cdcf53b5d4b8730ec0f9ea5 100644 (file)
@@ -6,12 +6,12 @@ extern struct console xenboot_console;
 #ifdef CONFIG_HVC_XEN
 void xen_console_resume(void);
 void xen_raw_console_write(const char *str);
-__attribute__((format(printf, 1, 2)))
+__printf(1, 2)
 void xen_raw_printk(const char *fmt, ...);
 #else
 static inline void xen_console_resume(void) { }
 static inline void xen_raw_console_write(const char *str) { }
-static inline __attribute__((format(printf, 1, 2)))
+static inline __printf(1, 2)
 void xen_raw_printk(const char *fmt, ...) { }
 #endif
 
index 553a7a21af5e886654448ec5ab0beb06aa42c4f2..b1b6676c1c438485ad48b04db6f8d87f2ed3c432 100644 (file)
@@ -157,9 +157,9 @@ int xenbus_scanf(struct xenbus_transaction t,
        __attribute__((format(scanf, 4, 5)));
 
 /* Single printf and write: returns -errno or 0. */
+__printf(4, 5)
 int xenbus_printf(struct xenbus_transaction t,
-                 const char *dir, const char *node, const char *fmt, ...)
-       __attribute__((format(printf, 4, 5)));
+                 const char *dir, const char *node, const char *fmt, ...);
 
 /* Generic read function: NULL-terminated triples of name,
  * sprintf-style type string, and pointer. Returns 0 or errno.*/
@@ -201,11 +201,11 @@ int xenbus_watch_path(struct xenbus_device *dev, const char *path,
                      struct xenbus_watch *watch,
                      void (*callback)(struct xenbus_watch *,
                                       const char **, unsigned int));
+__printf(4, 5)
 int xenbus_watch_pathfmt(struct xenbus_device *dev, struct xenbus_watch *watch,
                         void (*callback)(struct xenbus_watch *,
                                          const char **, unsigned int),
-                        const char *pathfmt, ...)
-       __attribute__ ((format (printf, 4, 5)));
+                        const char *pathfmt, ...);
 
 int xenbus_switch_state(struct xenbus_device *dev, enum xenbus_state new_state);
 int xenbus_grant_ring(struct xenbus_device *dev, unsigned long ring_mfn);
@@ -224,9 +224,9 @@ int xenbus_free_evtchn(struct xenbus_device *dev, int port);
 
 enum xenbus_state xenbus_read_driver_state(const char *path);
 
-__attribute__((format(printf, 3, 4)))
+__printf(3, 4)
 void xenbus_dev_error(struct xenbus_device *dev, int err, const char *fmt, ...);
-__attribute__((format(printf, 3, 4)))
+__printf(3, 4)
 void xenbus_dev_fatal(struct xenbus_device *dev, int err, const char *fmt, ...);
 
 const char *xenbus_strstate(enum xenbus_state state);
index b6753f45624e3e3fdd17c4338173778ee21b136b..d86583f4831d73f7fd4ee6a8d4f898eb3b1a3f3e 100644 (file)
@@ -27,7 +27,7 @@
 #include <net/nfc/nfc.h>
 #include <net/sock.h>
 
-__attribute__((format (printf, 2, 3)))
+__printf(2, 3)
 int nfc_printk(const char *level, const char *fmt, ...);
 
 #define nfc_info(fmt, arg...) nfc_printk(KERN_INFO, fmt, ##arg)
index da8adac2bf06f95504ba21e8fdc6c5e09435ca9e..7eaba1831f0d522ffbe38e82ce60d3cb80d1065f 100644 (file)
@@ -36,8 +36,8 @@
 #define rdsdebug(fmt, args...) pr_debug("%s(): " fmt, __func__ , ##args)
 #else
 /* sigh, pr_debug() causes unused variable warnings */
-static inline void __attribute__ ((format (printf, 1, 2)))
-rdsdebug(char *fmt, ...)
+static inline __printf(1, 2)
+void rdsdebug(char *fmt, ...)
 {
 }
 #endif
@@ -625,8 +625,8 @@ void rds_for_each_conn_info(struct socket *sock, unsigned int len,
                          struct rds_info_lengths *lens,
                          int (*visitor)(struct rds_connection *, void *),
                          size_t item_len);
-void __rds_conn_error(struct rds_connection *conn, const char *, ...)
-                               __attribute__ ((format (printf, 2, 3)));
+__printf(2, 3)
+void __rds_conn_error(struct rds_connection *conn, const char *, ...);
 #define rds_conn_error(conn, fmt...) \
        __rds_conn_error(conn, KERN_WARNING "RDS: " fmt)
 
index 30d70abb4e2c7e7577758b4857401a04b1992b0f..dd5cc00ed5593c04e66825ab9cdb0beb19810592 100644 (file)
@@ -971,9 +971,8 @@ static void svc_unregister(const struct svc_serv *serv)
 /*
  * Printk the given error with the address of the client that caused it.
  */
-static int
-__attribute__ ((format (printf, 2, 3)))
-svc_printk(struct svc_rqst *rqstp, const char *fmt, ...)
+static __printf(2, 3)
+int svc_printk(struct svc_rqst *rqstp, const char *fmt, ...)
 {
        va_list args;
        int     r;
index 14cacbc655dd790261db8962090c075d7a993a70..76294f2ae47f142fe128da90d5243a7ce2eac589 100644 (file)
@@ -32,7 +32,7 @@ enum bus_reset_handling {
        SUCCEED_ON_BUS_RESET,
 };
 
-static __attribute__((format(printf, 2, 3)))
+static __printf(2, 3)
 void cmp_error(struct cmp_connection *c, const char *fmt, ...)
 {
        va_list va;