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 /include/linux/netdevice.h | |
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 'include/linux/netdevice.h')
-rw-r--r-- | include/linux/netdevice.h | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index df1c836e6948..cbeb5867cff7 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -2622,23 +2622,23 @@ static inline const char *netdev_name(const struct net_device *dev) | |||
2622 | extern int __netdev_printk(const char *level, const struct net_device *dev, | 2622 | extern int __netdev_printk(const char *level, const struct net_device *dev, |
2623 | struct va_format *vaf); | 2623 | struct va_format *vaf); |
2624 | 2624 | ||
2625 | extern int netdev_printk(const char *level, const struct net_device *dev, | 2625 | extern __printf(3, 4) |
2626 | const char *format, ...) | 2626 | int netdev_printk(const char *level, const struct net_device *dev, |
2627 | __attribute__ ((format (printf, 3, 4))); | 2627 | const char *format, ...); |
2628 | extern int netdev_emerg(const struct net_device *dev, const char *format, ...) | 2628 | extern __printf(2, 3) |
2629 | __attribute__ ((format (printf, 2, 3))); | 2629 | int netdev_emerg(const struct net_device *dev, const char *format, ...); |
2630 | extern int netdev_alert(const struct net_device *dev, const char *format, ...) | 2630 | extern __printf(2, 3) |
2631 | __attribute__ ((format (printf, 2, 3))); | 2631 | int netdev_alert(const struct net_device *dev, const char *format, ...); |
2632 | extern int netdev_crit(const struct net_device *dev, const char *format, ...) | 2632 | extern __printf(2, 3) |
2633 | __attribute__ ((format (printf, 2, 3))); | 2633 | int netdev_crit(const struct net_device *dev, const char *format, ...); |
2634 | extern int netdev_err(const struct net_device *dev, const char *format, ...) | 2634 | extern __printf(2, 3) |
2635 | __attribute__ ((format (printf, 2, 3))); | 2635 | int netdev_err(const struct net_device *dev, const char *format, ...); |
2636 | extern int netdev_warn(const struct net_device *dev, const char *format, ...) | 2636 | extern __printf(2, 3) |
2637 | __attribute__ ((format (printf, 2, 3))); | 2637 | int netdev_warn(const struct net_device *dev, const char *format, ...); |
2638 | extern int netdev_notice(const struct net_device *dev, const char *format, ...) | 2638 | extern __printf(2, 3) |
2639 | __attribute__ ((format (printf, 2, 3))); | 2639 | int netdev_notice(const struct net_device *dev, const char *format, ...); |
2640 | extern int netdev_info(const struct net_device *dev, const char *format, ...) | 2640 | extern __printf(2, 3) |
2641 | __attribute__ ((format (printf, 2, 3))); | 2641 | int netdev_info(const struct net_device *dev, const char *format, ...); |
2642 | 2642 | ||
2643 | #define MODULE_ALIAS_NETDEV(device) \ | 2643 | #define MODULE_ALIAS_NETDEV(device) \ |
2644 | MODULE_ALIAS("netdev-" device) | 2644 | MODULE_ALIAS("netdev-" device) |