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 /fs/ext4 | |
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 'fs/ext4')
-rw-r--r-- | fs/ext4/ext4.h | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index b7d7bd0f066e..cec3145e532c 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h | |||
@@ -1878,40 +1878,40 @@ extern int ext4_group_extend(struct super_block *sb, | |||
1878 | extern void *ext4_kvmalloc(size_t size, gfp_t flags); | 1878 | extern void *ext4_kvmalloc(size_t size, gfp_t flags); |
1879 | extern void *ext4_kvzalloc(size_t size, gfp_t flags); | 1879 | extern void *ext4_kvzalloc(size_t size, gfp_t flags); |
1880 | extern void ext4_kvfree(void *ptr); | 1880 | extern void ext4_kvfree(void *ptr); |
1881 | extern void __ext4_error(struct super_block *, const char *, unsigned int, | 1881 | extern __printf(4, 5) |
1882 | const char *, ...) | 1882 | void __ext4_error(struct super_block *, const char *, unsigned int, |
1883 | __attribute__ ((format (printf, 4, 5))); | 1883 | const char *, ...); |
1884 | #define ext4_error(sb, message...) __ext4_error(sb, __func__, \ | 1884 | #define ext4_error(sb, message...) __ext4_error(sb, __func__, \ |
1885 | __LINE__, ## message) | 1885 | __LINE__, ## message) |
1886 | extern void ext4_error_inode(struct inode *, const char *, unsigned int, | 1886 | extern __printf(5, 6) |
1887 | ext4_fsblk_t, const char *, ...) | 1887 | void ext4_error_inode(struct inode *, const char *, unsigned int, ext4_fsblk_t, |
1888 | __attribute__ ((format (printf, 5, 6))); | 1888 | const char *, ...); |
1889 | extern void ext4_error_file(struct file *, const char *, unsigned int, | 1889 | extern __printf(5, 6) |
1890 | ext4_fsblk_t, const char *, ...) | 1890 | void ext4_error_file(struct file *, const char *, unsigned int, ext4_fsblk_t, |
1891 | __attribute__ ((format (printf, 5, 6))); | 1891 | const char *, ...); |
1892 | extern void __ext4_std_error(struct super_block *, const char *, | 1892 | extern void __ext4_std_error(struct super_block *, const char *, |
1893 | unsigned int, int); | 1893 | unsigned int, int); |
1894 | extern void __ext4_abort(struct super_block *, const char *, unsigned int, | 1894 | extern __printf(4, 5) |
1895 | const char *, ...) | 1895 | void __ext4_abort(struct super_block *, const char *, unsigned int, |
1896 | __attribute__ ((format (printf, 4, 5))); | 1896 | const char *, ...); |
1897 | #define ext4_abort(sb, message...) __ext4_abort(sb, __func__, \ | 1897 | #define ext4_abort(sb, message...) __ext4_abort(sb, __func__, \ |
1898 | __LINE__, ## message) | 1898 | __LINE__, ## message) |
1899 | extern void __ext4_warning(struct super_block *, const char *, unsigned int, | 1899 | extern __printf(4, 5) |
1900 | const char *, ...) | 1900 | void __ext4_warning(struct super_block *, const char *, unsigned int, |
1901 | __attribute__ ((format (printf, 4, 5))); | 1901 | const char *, ...); |
1902 | #define ext4_warning(sb, message...) __ext4_warning(sb, __func__, \ | 1902 | #define ext4_warning(sb, message...) __ext4_warning(sb, __func__, \ |
1903 | __LINE__, ## message) | 1903 | __LINE__, ## message) |
1904 | extern void ext4_msg(struct super_block *, const char *, const char *, ...) | 1904 | extern __printf(3, 4) |
1905 | __attribute__ ((format (printf, 3, 4))); | 1905 | void ext4_msg(struct super_block *, const char *, const char *, ...); |
1906 | extern void __dump_mmp_msg(struct super_block *, struct mmp_struct *mmp, | 1906 | extern void __dump_mmp_msg(struct super_block *, struct mmp_struct *mmp, |
1907 | const char *, unsigned int, const char *); | 1907 | const char *, unsigned int, const char *); |
1908 | #define dump_mmp_msg(sb, mmp, msg) __dump_mmp_msg(sb, mmp, __func__, \ | 1908 | #define dump_mmp_msg(sb, mmp, msg) __dump_mmp_msg(sb, mmp, __func__, \ |
1909 | __LINE__, msg) | 1909 | __LINE__, msg) |
1910 | extern void __ext4_grp_locked_error(const char *, unsigned int, \ | 1910 | extern __printf(7, 8) |
1911 | struct super_block *, ext4_group_t, \ | 1911 | void __ext4_grp_locked_error(const char *, unsigned int, |
1912 | unsigned long, ext4_fsblk_t, \ | 1912 | struct super_block *, ext4_group_t, |
1913 | const char *, ...) | 1913 | unsigned long, ext4_fsblk_t, |
1914 | __attribute__ ((format (printf, 7, 8))); | 1914 | const char *, ...); |
1915 | #define ext4_grp_locked_error(sb, grp, message...) \ | 1915 | #define ext4_grp_locked_error(sb, grp, message...) \ |
1916 | __ext4_grp_locked_error(__func__, __LINE__, (sb), (grp), ## message) | 1916 | __ext4_grp_locked_error(__func__, __LINE__, (sb), (grp), ## message) |
1917 | extern void ext4_update_dynamic_rev(struct super_block *sb); | 1917 | extern void ext4_update_dynamic_rev(struct super_block *sb); |