mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
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>
This commit is contained in:
committed by
Linus Torvalds
parent
ae29bc92da
commit
b9075fa968
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user