From 7dc2316887f60bacfda298dfe9252c31c5318f28 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Wed, 5 Oct 2011 11:43:29 +1100 Subject: [PATCH] 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 --- arch/s390/include/asm/debug.h | 4 ++-- fs/ext2/ext2.h | 2 +- fs/partitions/ldm.c | 2 +- fs/ufs/ufs.h | 6 +++--- include/linux/ext3_fs.h | 6 +++--- include/linux/kernel.h | 6 +++--- 6 files changed, 13 insertions(+), 13 deletions(-) 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 883f310133ae..81965cce6bfa 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) -- 2.39.5