From: Andrew Morton Date: Wed, 5 Oct 2011 00:43:29 +0000 (+1100) Subject: treewide-use-__printf-not-__attribute__formatprintf-checkpatch-fixes X-Git-Tag: next-20111014~3^2~102 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=644d7a557b415a6d6f1790e66a69e3f49fc77f49;p=karo-tx-linux.git treewide-use-__printf-not-__attribute__formatprintf-checkpatch-fixes WARNING: externs should be avoided in .c files #99: FILE: arch/alpha/boot/misc.c:28: +extern __printf(1, 2) long srm_printk(const char *, ...); ERROR: space required after that ';' (ctx:VxV) #178: FILE: arch/powerpc/boot/ps3.c:39: +static inline __printf(1, 2) int DBG(const char *fmt, ...) {return 0;} ^ ERROR: "foo* bar" should be "foo *bar" #225: FILE: arch/s390/include/asm/debug.h:175: +debug_sprintf_event(debug_info_t* id, int level, char *string, ...); ERROR: space required after that ',' (ctx:VxV) #237: FILE: arch/s390/include/asm/debug.h:216: +debug_sprintf_exception(debug_info_t *id, int level, char *string,...); ^ WARNING: space prohibited between function name and open parenthesis '(' #494: FILE: fs/ext2/ext2.h:139: +void ext2_error (struct super_block *, const char *, const char *, ...); WARNING: printk() should include KERN_ facility level #719: FILE: fs/partitions/ldm.c:63: + printk("%s%s(): %pV\n", level, function, &vaf); WARNING: space prohibited between function name and open parenthesis '(' #721: FILE: fs/partitions/ldm.c:65: + va_end (args); WARNING: space prohibited between function name and open parenthesis '(' #750: FILE: fs/ufs/ufs.h:121: +void ufs_warning (struct super_block *, const char *, const char *, ...); WARNING: space prohibited between function name and open parenthesis '(' #752: FILE: fs/ufs/ufs.h:123: +void ufs_error (struct super_block *, const char *, const char *, ...); WARNING: space prohibited between function name and open parenthesis '(' #754: FILE: fs/ufs/ufs.h:125: +void ufs_panic (struct super_block *, const char *, const char *, ...); WARNING: space prohibited between function name and open parenthesis '(' #1074: FILE: include/linux/ext3_fs.h:941: +void ext3_error (struct super_block *, const char *, const char *, ...); WARNING: space prohibited between function name and open parenthesis '(' #1083: FILE: include/linux/ext3_fs.h:944: +void ext3_abort (struct super_block *, const char *, const char *, ...); WARNING: space prohibited between function name and open parenthesis '(' #1085: FILE: include/linux/ext3_fs.h:946: +void ext3_warning (struct super_block *, const char *, const char *, ...); WARNING: do not add new typedefs #1178: FILE: include/linux/kdb.h:119: +typedef __printf(1, 2) int (*kdb_printf_t)(const char *, ...); ERROR: "foo * bar" should be "foo *bar" #1203: FILE: include/linux/kernel.h:299: +extern __printf(2, 3) int sprintf(char * buf, const char * fmt, ...); ERROR: "foo * bar" should be "foo *bar" #1206: FILE: include/linux/kernel.h:302: +int snprintf(char * buf, size_t size, const char * fmt, ...); ERROR: "foo * bar" should be "foo *bar" #1210: FILE: include/linux/kernel.h:306: +int scnprintf(char * buf, size_t size, const char * fmt, ...); total: 6 errors, 11 warnings, 1375 lines checked ./patches/treewide-use-__printf-not-__attribute__formatprintf.patch has style problems, please review. If any of these errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. Please run checkpatch prior to sending patches Cc: Joe Perches Signed-off-by: Andrew Morton --- diff --git a/arch/s390/include/asm/debug.h b/arch/s390/include/asm/debug.h index cea7114ce57d..770f6f408bf0 100644 --- a/arch/s390/include/asm/debug.h +++ b/arch/s390/include/asm/debug.h @@ -172,7 +172,7 @@ debug_text_event(debug_info_t* id, int level, const char* txt) * stored in the s390dbf. See Documentation/s390/s390dbf.txt for more details! */ extern __printf(3, 4) debug_entry_t * -debug_sprintf_event(debug_info_t* id, int level, char *string, ...); +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) @@ -213,7 +213,7 @@ debug_text_exception(debug_info_t* id, int level, const char* txt) * stored in the s390dbf. See Documentation/s390/s390dbf.txt for more details! */ extern __printf(3, 4) debug_entry_t * -debug_sprintf_exception(debug_info_t *id, int level, char *string,...); +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); diff --git a/fs/ext2/ext2.h b/fs/ext2/ext2.h index 4f4921c27ee2..9a4e5e206d08 100644 --- a/fs/ext2/ext2.h +++ b/fs/ext2/ext2.h @@ -136,7 +136,7 @@ struct dentry *ext2_get_parent(struct dentry *child); /* super.c */ extern __printf(3, 4) -void ext2_error (struct super_block *, const char *, const char *, ...); +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); diff --git a/fs/partitions/ldm.c b/fs/partitions/ldm.c index 8af67234aad3..bd8ae788f689 100644 --- a/fs/partitions/ldm.c +++ b/fs/partitions/ldm.c @@ -62,7 +62,7 @@ void _ldm_printk(const char *level, const char *function, const char *fmt, ...) printk("%s%s(): %pV\n", level, function, &vaf); - va_end (args); + va_end(args); } /** diff --git a/fs/ufs/ufs.h b/fs/ufs/ufs.h index 19d2d1cf6bc1..c26f2bcec264 100644 --- a/fs/ufs/ufs.h +++ b/fs/ufs/ufs.h @@ -118,11 +118,11 @@ extern const struct file_operations ufs_dir_operations; /* super.c */ extern __printf(3, 4) -void ufs_warning (struct super_block *, const char *, const char *, ...); +void ufs_warning(struct super_block *, const char *, const char *, ...); extern __printf(3, 4) -void ufs_error (struct super_block *, const char *, const char *, ...); +void ufs_error(struct super_block *, const char *, const char *, ...); extern __printf(3, 4) -void ufs_panic (struct super_block *, const char *, const char *, ...); +void ufs_panic(struct super_block *, const char *, const char *, ...); /* symlink.c */ extern const struct inode_operations ufs_fast_symlink_inode_operations; diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h index 430349d7fca6..dec99116a0e4 100644 --- a/include/linux/ext3_fs.h +++ b/include/linux/ext3_fs.h @@ -938,12 +938,12 @@ extern int ext3_group_extend(struct super_block *sb, /* super.c */ extern __printf(3, 4) -void ext3_error (struct super_block *, const char *, const char *, ...); +void ext3_error(struct super_block *, const char *, const char *, ...); extern void __ext3_std_error (struct super_block *, const char *, int); extern __printf(3, 4) -void ext3_abort (struct super_block *, const char *, const char *, ...); +void ext3_abort(struct super_block *, const char *, const char *, ...); extern __printf(3, 4) -void ext3_warning (struct super_block *, const char *, const char *, ...); +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); diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 3f8a419ccfe6..e40c950e1d62 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -296,14 +296,14 @@ extern long long simple_strtoll(const char *,char **,unsigned int); #define strict_strtoull kstrtoull #define strict_strtoll kstrtoll -extern __printf(2, 3) int sprintf(char * buf, const char * fmt, ...); +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, ...); +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, ...); +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)