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
@@ -584,14 +584,13 @@ extern int audit_signals;
|
||||
#ifdef CONFIG_AUDIT
|
||||
/* These are defined in audit.c */
|
||||
/* Public API */
|
||||
extern void audit_log(struct audit_context *ctx, gfp_t gfp_mask,
|
||||
int type, const char *fmt, ...)
|
||||
__attribute__((format(printf,4,5)));
|
||||
extern __printf(4, 5)
|
||||
void audit_log(struct audit_context *ctx, gfp_t gfp_mask, int type,
|
||||
const char *fmt, ...);
|
||||
|
||||
extern struct audit_buffer *audit_log_start(struct audit_context *ctx, gfp_t gfp_mask, int type);
|
||||
extern void audit_log_format(struct audit_buffer *ab,
|
||||
const char *fmt, ...)
|
||||
__attribute__((format(printf,2,3)));
|
||||
extern __printf(2, 3)
|
||||
void audit_log_format(struct audit_buffer *ab, const char *fmt, ...);
|
||||
extern void audit_log_end(struct audit_buffer *ab);
|
||||
extern int audit_string_contains_control(const char *string,
|
||||
size_t len);
|
||||
|
||||
@@ -170,7 +170,7 @@ extern void blk_trace_shutdown(struct request_queue *);
|
||||
extern int do_blk_trace_setup(struct request_queue *q, char *name,
|
||||
dev_t dev, struct block_device *bdev,
|
||||
struct blk_user_trace_setup *buts);
|
||||
extern __attribute__((format(printf, 2, 3)))
|
||||
extern __printf(2, 3)
|
||||
void __trace_note_message(struct blk_trace *, const char *fmt, ...);
|
||||
|
||||
/**
|
||||
|
||||
@@ -622,8 +622,8 @@ static inline const char *dev_name(const struct device *dev)
|
||||
return kobject_name(&dev->kobj);
|
||||
}
|
||||
|
||||
extern int dev_set_name(struct device *dev, const char *name, ...)
|
||||
__attribute__((format(printf, 2, 3)));
|
||||
extern __printf(2, 3)
|
||||
int dev_set_name(struct device *dev, const char *name, ...);
|
||||
|
||||
#ifdef CONFIG_NUMA
|
||||
static inline int dev_to_node(struct device *dev)
|
||||
@@ -753,10 +753,10 @@ extern struct device *device_create_vargs(struct class *cls,
|
||||
void *drvdata,
|
||||
const char *fmt,
|
||||
va_list vargs);
|
||||
extern struct device *device_create(struct class *cls, struct device *parent,
|
||||
dev_t devt, void *drvdata,
|
||||
const char *fmt, ...)
|
||||
__attribute__((format(printf, 5, 6)));
|
||||
extern __printf(5, 6)
|
||||
struct device *device_create(struct class *cls, struct device *parent,
|
||||
dev_t devt, void *drvdata,
|
||||
const char *fmt, ...);
|
||||
extern void device_destroy(struct class *cls, dev_t devt);
|
||||
|
||||
/*
|
||||
@@ -800,64 +800,56 @@ extern const char *dev_driver_string(const struct device *dev);
|
||||
|
||||
extern int __dev_printk(const char *level, const struct device *dev,
|
||||
struct va_format *vaf);
|
||||
extern int dev_printk(const char *level, const struct device *dev,
|
||||
const char *fmt, ...)
|
||||
__attribute__ ((format (printf, 3, 4)));
|
||||
extern int dev_emerg(const struct device *dev, const char *fmt, ...)
|
||||
__attribute__ ((format (printf, 2, 3)));
|
||||
extern int dev_alert(const struct device *dev, const char *fmt, ...)
|
||||
__attribute__ ((format (printf, 2, 3)));
|
||||
extern int dev_crit(const struct device *dev, const char *fmt, ...)
|
||||
__attribute__ ((format (printf, 2, 3)));
|
||||
extern int dev_err(const struct device *dev, const char *fmt, ...)
|
||||
__attribute__ ((format (printf, 2, 3)));
|
||||
extern int dev_warn(const struct device *dev, const char *fmt, ...)
|
||||
__attribute__ ((format (printf, 2, 3)));
|
||||
extern int dev_notice(const struct device *dev, const char *fmt, ...)
|
||||
__attribute__ ((format (printf, 2, 3)));
|
||||
extern int _dev_info(const struct device *dev, const char *fmt, ...)
|
||||
__attribute__ ((format (printf, 2, 3)));
|
||||
extern __printf(3, 4)
|
||||
int dev_printk(const char *level, const struct device *dev,
|
||||
const char *fmt, ...)
|
||||
;
|
||||
extern __printf(2, 3)
|
||||
int dev_emerg(const struct device *dev, const char *fmt, ...);
|
||||
extern __printf(2, 3)
|
||||
int dev_alert(const struct device *dev, const char *fmt, ...);
|
||||
extern __printf(2, 3)
|
||||
int dev_crit(const struct device *dev, const char *fmt, ...);
|
||||
extern __printf(2, 3)
|
||||
int dev_err(const struct device *dev, const char *fmt, ...);
|
||||
extern __printf(2, 3)
|
||||
int dev_warn(const struct device *dev, const char *fmt, ...);
|
||||
extern __printf(2, 3)
|
||||
int dev_notice(const struct device *dev, const char *fmt, ...);
|
||||
extern __printf(2, 3)
|
||||
int _dev_info(const struct device *dev, const char *fmt, ...);
|
||||
|
||||
#else
|
||||
|
||||
static inline int __dev_printk(const char *level, const struct device *dev,
|
||||
struct va_format *vaf)
|
||||
{ return 0; }
|
||||
static inline int dev_printk(const char *level, const struct device *dev,
|
||||
const char *fmt, ...)
|
||||
__attribute__ ((format (printf, 3, 4)));
|
||||
static inline int dev_printk(const char *level, const struct device *dev,
|
||||
const char *fmt, ...)
|
||||
{ return 0; }
|
||||
{ return 0; }
|
||||
static inline __printf(3, 4)
|
||||
int dev_printk(const char *level, const struct device *dev,
|
||||
const char *fmt, ...)
|
||||
{ return 0; }
|
||||
|
||||
static inline int dev_emerg(const struct device *dev, const char *fmt, ...)
|
||||
__attribute__ ((format (printf, 2, 3)));
|
||||
static inline int dev_emerg(const struct device *dev, const char *fmt, ...)
|
||||
{ return 0; }
|
||||
static inline int dev_crit(const struct device *dev, const char *fmt, ...)
|
||||
__attribute__ ((format (printf, 2, 3)));
|
||||
static inline int dev_crit(const struct device *dev, const char *fmt, ...)
|
||||
{ return 0; }
|
||||
static inline int dev_alert(const struct device *dev, const char *fmt, ...)
|
||||
__attribute__ ((format (printf, 2, 3)));
|
||||
static inline int dev_alert(const struct device *dev, const char *fmt, ...)
|
||||
{ return 0; }
|
||||
static inline int dev_err(const struct device *dev, const char *fmt, ...)
|
||||
__attribute__ ((format (printf, 2, 3)));
|
||||
static inline int dev_err(const struct device *dev, const char *fmt, ...)
|
||||
{ return 0; }
|
||||
static inline int dev_warn(const struct device *dev, const char *fmt, ...)
|
||||
__attribute__ ((format (printf, 2, 3)));
|
||||
static inline int dev_warn(const struct device *dev, const char *fmt, ...)
|
||||
{ return 0; }
|
||||
static inline int dev_notice(const struct device *dev, const char *fmt, ...)
|
||||
__attribute__ ((format (printf, 2, 3)));
|
||||
static inline int dev_notice(const struct device *dev, const char *fmt, ...)
|
||||
{ return 0; }
|
||||
static inline int _dev_info(const struct device *dev, const char *fmt, ...)
|
||||
__attribute__ ((format (printf, 2, 3)));
|
||||
static inline int _dev_info(const struct device *dev, const char *fmt, ...)
|
||||
{ return 0; }
|
||||
static inline __printf(2, 3)
|
||||
int dev_emerg(const struct device *dev, const char *fmt, ...)
|
||||
{ return 0; }
|
||||
static inline __printf(2, 3)
|
||||
int dev_crit(const struct device *dev, const char *fmt, ...)
|
||||
{ return 0; }
|
||||
static inline __printf(2, 3)
|
||||
int dev_alert(const struct device *dev, const char *fmt, ...)
|
||||
{ return 0; }
|
||||
static inline __printf(2, 3)
|
||||
int dev_err(const struct device *dev, const char *fmt, ...)
|
||||
{ return 0; }
|
||||
static inline __printf(2, 3)
|
||||
int dev_warn(const struct device *dev, const char *fmt, ...)
|
||||
{ return 0; }
|
||||
static inline __printf(2, 3)
|
||||
int dev_notice(const struct device *dev, const char *fmt, ...)
|
||||
{ return 0; }
|
||||
static inline __printf(2, 3)
|
||||
int _dev_info(const struct device *dev, const char *fmt, ...)
|
||||
{ return 0; }
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -37,22 +37,21 @@ int ddebug_add_module(struct _ddebug *tab, unsigned int n,
|
||||
|
||||
#if defined(CONFIG_DYNAMIC_DEBUG)
|
||||
extern int ddebug_remove_module(const char *mod_name);
|
||||
extern int __dynamic_pr_debug(struct _ddebug *descriptor, const char *fmt, ...)
|
||||
__attribute__ ((format (printf, 2, 3)));
|
||||
extern __printf(2, 3)
|
||||
int __dynamic_pr_debug(struct _ddebug *descriptor, const char *fmt, ...);
|
||||
|
||||
struct device;
|
||||
|
||||
extern int __dynamic_dev_dbg(struct _ddebug *descriptor,
|
||||
const struct device *dev,
|
||||
const char *fmt, ...)
|
||||
__attribute__ ((format (printf, 3, 4)));
|
||||
extern __printf(3, 4)
|
||||
int __dynamic_dev_dbg(struct _ddebug *descriptor, const struct device *dev,
|
||||
const char *fmt, ...);
|
||||
|
||||
struct net_device;
|
||||
|
||||
extern int __dynamic_netdev_dbg(struct _ddebug *descriptor,
|
||||
const struct net_device *dev,
|
||||
const char *fmt, ...)
|
||||
__attribute__ ((format (printf, 3, 4)));
|
||||
extern __printf(3, 4)
|
||||
int __dynamic_netdev_dbg(struct _ddebug *descriptor,
|
||||
const struct net_device *dev,
|
||||
const char *fmt, ...);
|
||||
|
||||
#define DEFINE_DYNAMIC_DEBUG_METADATA(name, fmt) \
|
||||
static struct _ddebug __used __aligned(8) \
|
||||
|
||||
@@ -937,15 +937,15 @@ extern int ext3_group_extend(struct super_block *sb,
|
||||
ext3_fsblk_t n_blocks_count);
|
||||
|
||||
/* super.c */
|
||||
extern void ext3_error (struct super_block *, const char *, const char *, ...)
|
||||
__attribute__ ((format (printf, 3, 4)));
|
||||
extern __printf(3, 4)
|
||||
void ext3_error(struct super_block *, const char *, const char *, ...);
|
||||
extern void __ext3_std_error (struct super_block *, const char *, int);
|
||||
extern void ext3_abort (struct super_block *, const char *, const char *, ...)
|
||||
__attribute__ ((format (printf, 3, 4)));
|
||||
extern void ext3_warning (struct super_block *, const char *, const char *, ...)
|
||||
__attribute__ ((format (printf, 3, 4)));
|
||||
extern void ext3_msg(struct super_block *, const char *, const char *, ...)
|
||||
__attribute__ ((format (printf, 3, 4)));
|
||||
extern __printf(3, 4)
|
||||
void ext3_abort(struct super_block *, const char *, const char *, ...);
|
||||
extern __printf(3, 4)
|
||||
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);
|
||||
|
||||
#define ext3_std_error(sb, errno) \
|
||||
|
||||
@@ -2635,8 +2635,8 @@ static const struct file_operations __fops = { \
|
||||
.llseek = generic_file_llseek, \
|
||||
};
|
||||
|
||||
static inline void __attribute__((format(printf, 1, 2)))
|
||||
__simple_attr_check_format(const char *fmt, ...)
|
||||
static inline __printf(1, 2)
|
||||
void __simple_attr_check_format(const char *fmt, ...)
|
||||
{
|
||||
/* don't do anything, just let the compiler check the arguments; */
|
||||
}
|
||||
|
||||
@@ -492,10 +492,10 @@ static inline void fscache_end_io(struct fscache_retrieval *op,
|
||||
/*
|
||||
* out-of-line cache backend functions
|
||||
*/
|
||||
extern void fscache_init_cache(struct fscache_cache *cache,
|
||||
const struct fscache_cache_ops *ops,
|
||||
const char *idfmt,
|
||||
...) __attribute__ ((format (printf, 3, 4)));
|
||||
extern __printf(3, 4)
|
||||
void fscache_init_cache(struct fscache_cache *cache,
|
||||
const struct fscache_cache_ops *ops,
|
||||
const char *idfmt, ...);
|
||||
|
||||
extern int fscache_add_cache(struct fscache_cache *cache,
|
||||
struct fscache_object *fsdef,
|
||||
|
||||
@@ -78,8 +78,8 @@ static inline void gameport_register_port(struct gameport *gameport)
|
||||
|
||||
void gameport_unregister_port(struct gameport *gameport);
|
||||
|
||||
void gameport_set_phys(struct gameport *gameport, const char *fmt, ...)
|
||||
__attribute__ ((format (printf, 2, 3)));
|
||||
__printf(2, 3)
|
||||
void gameport_set_phys(struct gameport *gameport, const char *fmt, ...);
|
||||
|
||||
#else
|
||||
|
||||
@@ -93,8 +93,8 @@ static inline void gameport_unregister_port(struct gameport *gameport)
|
||||
return;
|
||||
}
|
||||
|
||||
static inline void gameport_set_phys(struct gameport *gameport,
|
||||
const char *fmt, ...)
|
||||
static inline __printf(2, 3)
|
||||
void gameport_set_phys(struct gameport *gameport, const char *fmt, ...)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -101,9 +101,8 @@ static inline int lookup_symbol_attrs(unsigned long addr, unsigned long *size, u
|
||||
#endif /*CONFIG_KALLSYMS*/
|
||||
|
||||
/* This macro allows us to keep printk typechecking */
|
||||
static void __check_printsym_format(const char *fmt, ...)
|
||||
__attribute__((format(printf,1,2)));
|
||||
static inline void __check_printsym_format(const char *fmt, ...)
|
||||
static __printf(1, 2)
|
||||
void __check_printsym_format(const char *fmt, ...)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -114,12 +114,9 @@ typedef enum {
|
||||
} kdb_reason_t;
|
||||
|
||||
extern int kdb_trap_printk;
|
||||
extern int vkdb_printf(const char *fmt, va_list args)
|
||||
__attribute__ ((format (printf, 1, 0)));
|
||||
extern int kdb_printf(const char *, ...)
|
||||
__attribute__ ((format (printf, 1, 2)));
|
||||
typedef int (*kdb_printf_t)(const char *, ...)
|
||||
__attribute__ ((format (printf, 1, 2)));
|
||||
extern __printf(1, 0) int vkdb_printf(const char *fmt, va_list args);
|
||||
extern __printf(1, 2) int kdb_printf(const char *, ...);
|
||||
typedef __printf(1, 2) int (*kdb_printf_t)(const char *, ...);
|
||||
|
||||
extern void kdb_init(int level);
|
||||
|
||||
|
||||
@@ -296,20 +296,18 @@ extern long long simple_strtoll(const char *,char **,unsigned int);
|
||||
#define strict_strtoull kstrtoull
|
||||
#define strict_strtoll kstrtoll
|
||||
|
||||
extern int sprintf(char * buf, const char * fmt, ...)
|
||||
__attribute__ ((format (printf, 2, 3)));
|
||||
extern int vsprintf(char *buf, const char *, va_list)
|
||||
__attribute__ ((format (printf, 2, 0)));
|
||||
extern int snprintf(char * buf, size_t size, const char * fmt, ...)
|
||||
__attribute__ ((format (printf, 3, 4)));
|
||||
extern int vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
|
||||
__attribute__ ((format (printf, 3, 0)));
|
||||
extern int scnprintf(char * buf, size_t size, const char * fmt, ...)
|
||||
__attribute__ ((format (printf, 3, 4)));
|
||||
extern int vscnprintf(char *buf, size_t size, const char *fmt, va_list args)
|
||||
__attribute__ ((format (printf, 3, 0)));
|
||||
extern char *kasprintf(gfp_t gfp, const char *fmt, ...)
|
||||
__attribute__ ((format (printf, 2, 3)));
|
||||
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, ...);
|
||||
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, ...);
|
||||
extern __printf(3, 0)
|
||||
int vscnprintf(char *buf, size_t size, const char *fmt, va_list args);
|
||||
extern __printf(2, 3)
|
||||
char *kasprintf(gfp_t gfp, const char *fmt, ...);
|
||||
extern char *kvasprintf(gfp_t gfp, const char *fmt, va_list args);
|
||||
|
||||
extern int sscanf(const char *, const char *, ...)
|
||||
@@ -427,8 +425,8 @@ extern void tracing_start(void);
|
||||
extern void tracing_stop(void);
|
||||
extern void ftrace_off_permanent(void);
|
||||
|
||||
static inline void __attribute__ ((format (printf, 1, 2)))
|
||||
____trace_printk_check_format(const char *fmt, ...)
|
||||
static inline __printf(1, 2)
|
||||
void ____trace_printk_check_format(const char *fmt, ...)
|
||||
{
|
||||
}
|
||||
#define __trace_printk_check_format(fmt, args...) \
|
||||
@@ -467,13 +465,11 @@ do { \
|
||||
__trace_printk(_THIS_IP_, fmt, ##args); \
|
||||
} while (0)
|
||||
|
||||
extern int
|
||||
__trace_bprintk(unsigned long ip, const char *fmt, ...)
|
||||
__attribute__ ((format (printf, 2, 3)));
|
||||
extern __printf(2, 3)
|
||||
int __trace_bprintk(unsigned long ip, const char *fmt, ...);
|
||||
|
||||
extern int
|
||||
__trace_printk(unsigned long ip, const char *fmt, ...)
|
||||
__attribute__ ((format (printf, 2, 3)));
|
||||
extern __printf(2, 3)
|
||||
int __trace_printk(unsigned long ip, const char *fmt, ...);
|
||||
|
||||
extern void trace_dump_stack(void);
|
||||
|
||||
@@ -502,8 +498,8 @@ __ftrace_vprintk(unsigned long ip, const char *fmt, va_list ap);
|
||||
|
||||
extern void ftrace_dump(enum ftrace_dump_mode oops_dump_mode);
|
||||
#else
|
||||
static inline int
|
||||
trace_printk(const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
|
||||
static inline __printf(1, 2)
|
||||
int trace_printk(const char *fmt, ...);
|
||||
|
||||
static inline void tracing_start(void) { }
|
||||
static inline void tracing_stop(void) { }
|
||||
|
||||
@@ -130,8 +130,8 @@ int kexec_should_crash(struct task_struct *);
|
||||
void crash_save_cpu(struct pt_regs *regs, int cpu);
|
||||
void crash_save_vmcoreinfo(void);
|
||||
void arch_crash_save_vmcoreinfo(void);
|
||||
void vmcoreinfo_append_str(const char *fmt, ...)
|
||||
__attribute__ ((format (printf, 1, 2)));
|
||||
__printf(1, 2)
|
||||
void vmcoreinfo_append_str(const char *fmt, ...);
|
||||
unsigned long paddr_vmcoreinfo_note(void);
|
||||
|
||||
#define VMCOREINFO_OSRELEASE(value) \
|
||||
|
||||
@@ -32,8 +32,8 @@
|
||||
extern char modprobe_path[]; /* for sysctl */
|
||||
/* modprobe exit status on success, -ve on error. Return value
|
||||
* usually useless though. */
|
||||
extern int __request_module(bool wait, const char *name, ...) \
|
||||
__attribute__((format(printf, 2, 3)));
|
||||
extern __printf(2, 3)
|
||||
int __request_module(bool wait, const char *name, ...);
|
||||
#define request_module(mod...) __request_module(true, mod)
|
||||
#define request_module_nowait(mod...) __request_module(false, mod)
|
||||
#define try_then_request_module(x, mod...) \
|
||||
|
||||
@@ -72,8 +72,8 @@ struct kobject {
|
||||
unsigned int uevent_suppress:1;
|
||||
};
|
||||
|
||||
extern int kobject_set_name(struct kobject *kobj, const char *name, ...)
|
||||
__attribute__((format(printf, 2, 3)));
|
||||
extern __printf(2, 3)
|
||||
int kobject_set_name(struct kobject *kobj, const char *name, ...);
|
||||
extern int kobject_set_name_vargs(struct kobject *kobj, const char *fmt,
|
||||
va_list vargs);
|
||||
|
||||
@@ -83,15 +83,13 @@ static inline const char *kobject_name(const struct kobject *kobj)
|
||||
}
|
||||
|
||||
extern void kobject_init(struct kobject *kobj, struct kobj_type *ktype);
|
||||
extern int __must_check kobject_add(struct kobject *kobj,
|
||||
struct kobject *parent,
|
||||
const char *fmt, ...)
|
||||
__attribute__((format(printf, 3, 4)));
|
||||
extern int __must_check kobject_init_and_add(struct kobject *kobj,
|
||||
struct kobj_type *ktype,
|
||||
struct kobject *parent,
|
||||
const char *fmt, ...)
|
||||
__attribute__((format(printf, 4, 5)));
|
||||
extern __printf(3, 4) __must_check
|
||||
int kobject_add(struct kobject *kobj, struct kobject *parent,
|
||||
const char *fmt, ...);
|
||||
extern __printf(4, 5) __must_check
|
||||
int kobject_init_and_add(struct kobject *kobj,
|
||||
struct kobj_type *ktype, struct kobject *parent,
|
||||
const char *fmt, ...);
|
||||
|
||||
extern void kobject_del(struct kobject *kobj);
|
||||
|
||||
@@ -212,8 +210,8 @@ int kobject_uevent(struct kobject *kobj, enum kobject_action action);
|
||||
int kobject_uevent_env(struct kobject *kobj, enum kobject_action action,
|
||||
char *envp[]);
|
||||
|
||||
int add_uevent_var(struct kobj_uevent_env *env, const char *format, ...)
|
||||
__attribute__((format (printf, 2, 3)));
|
||||
__printf(2, 3)
|
||||
int add_uevent_var(struct kobj_uevent_env *env, const char *format, ...);
|
||||
|
||||
int kobject_action_type(const char *buf, size_t count,
|
||||
enum kobject_action *type);
|
||||
@@ -226,7 +224,7 @@ static inline int kobject_uevent_env(struct kobject *kobj,
|
||||
char *envp[])
|
||||
{ return 0; }
|
||||
|
||||
static inline __attribute__((format(printf, 2, 3)))
|
||||
static inline __printf(2, 3)
|
||||
int add_uevent_var(struct kobj_uevent_env *env, const char *format, ...)
|
||||
{ return 0; }
|
||||
|
||||
|
||||
@@ -4,11 +4,11 @@
|
||||
#include <linux/err.h>
|
||||
#include <linux/sched.h>
|
||||
|
||||
__printf(4, 5)
|
||||
struct task_struct *kthread_create_on_node(int (*threadfn)(void *data),
|
||||
void *data,
|
||||
int node,
|
||||
const char namefmt[], ...)
|
||||
__attribute__((format(printf, 4, 5)));
|
||||
const char namefmt[], ...);
|
||||
|
||||
#define kthread_create(threadfn, data, namefmt, arg...) \
|
||||
kthread_create_on_node(threadfn, data, -1, namefmt, ##arg)
|
||||
|
||||
@@ -1256,13 +1256,13 @@ static inline int sata_srst_pmp(struct ata_link *link)
|
||||
/*
|
||||
* printk helpers
|
||||
*/
|
||||
__attribute__((format (printf, 3, 4)))
|
||||
__printf(3, 4)
|
||||
int ata_port_printk(const struct ata_port *ap, const char *level,
|
||||
const char *fmt, ...);
|
||||
__attribute__((format (printf, 3, 4)))
|
||||
__printf(3, 4)
|
||||
int ata_link_printk(const struct ata_link *link, const char *level,
|
||||
const char *fmt, ...);
|
||||
__attribute__((format (printf, 3, 4)))
|
||||
__printf(3, 4)
|
||||
int ata_dev_printk(const struct ata_device *dev, const char *level,
|
||||
const char *fmt, ...);
|
||||
|
||||
@@ -1304,10 +1304,10 @@ void ata_print_version(const struct device *dev, const char *version);
|
||||
/*
|
||||
* ata_eh_info helpers
|
||||
*/
|
||||
extern void __ata_ehi_push_desc(struct ata_eh_info *ehi, const char *fmt, ...)
|
||||
__attribute__ ((format (printf, 2, 3)));
|
||||
extern void ata_ehi_push_desc(struct ata_eh_info *ehi, const char *fmt, ...)
|
||||
__attribute__ ((format (printf, 2, 3)));
|
||||
extern __printf(2, 3)
|
||||
void __ata_ehi_push_desc(struct ata_eh_info *ehi, const char *fmt, ...);
|
||||
extern __printf(2, 3)
|
||||
void ata_ehi_push_desc(struct ata_eh_info *ehi, const char *fmt, ...);
|
||||
extern void ata_ehi_clear_desc(struct ata_eh_info *ehi);
|
||||
|
||||
static inline void ata_ehi_hotplugged(struct ata_eh_info *ehi)
|
||||
@@ -1321,8 +1321,8 @@ static inline void ata_ehi_hotplugged(struct ata_eh_info *ehi)
|
||||
/*
|
||||
* port description helpers
|
||||
*/
|
||||
extern void ata_port_desc(struct ata_port *ap, const char *fmt, ...)
|
||||
__attribute__ ((format (printf, 2, 3)));
|
||||
extern __printf(2, 3)
|
||||
void ata_port_desc(struct ata_port *ap, const char *fmt, ...);
|
||||
#ifdef CONFIG_PCI
|
||||
extern void ata_port_pbar_desc(struct ata_port *ap, int bar, ssize_t offset,
|
||||
const char *name);
|
||||
|
||||
@@ -49,8 +49,7 @@ extern void mmiotrace_ioremap(resource_size_t offset, unsigned long size,
|
||||
extern void mmiotrace_iounmap(volatile void __iomem *addr);
|
||||
|
||||
/* For anyone to insert markers. Remember trailing newline. */
|
||||
extern int mmiotrace_printk(const char *fmt, ...)
|
||||
__attribute__ ((format (printf, 1, 2)));
|
||||
extern __printf(1, 2) int mmiotrace_printk(const char *fmt, ...);
|
||||
#else /* !CONFIG_MMIOTRACE: */
|
||||
static inline int is_kmmio_active(void)
|
||||
{
|
||||
@@ -71,10 +70,7 @@ static inline void mmiotrace_iounmap(volatile void __iomem *addr)
|
||||
{
|
||||
}
|
||||
|
||||
static inline int mmiotrace_printk(const char *fmt, ...)
|
||||
__attribute__ ((format (printf, 1, 0)));
|
||||
|
||||
static inline int mmiotrace_printk(const char *fmt, ...)
|
||||
static inline __printf(1, 2) int mmiotrace_printk(const char *fmt, ...)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2622,23 +2622,23 @@ static inline const char *netdev_name(const struct net_device *dev)
|
||||
extern int __netdev_printk(const char *level, const struct net_device *dev,
|
||||
struct va_format *vaf);
|
||||
|
||||
extern int netdev_printk(const char *level, const struct net_device *dev,
|
||||
const char *format, ...)
|
||||
__attribute__ ((format (printf, 3, 4)));
|
||||
extern int netdev_emerg(const struct net_device *dev, const char *format, ...)
|
||||
__attribute__ ((format (printf, 2, 3)));
|
||||
extern int netdev_alert(const struct net_device *dev, const char *format, ...)
|
||||
__attribute__ ((format (printf, 2, 3)));
|
||||
extern int netdev_crit(const struct net_device *dev, const char *format, ...)
|
||||
__attribute__ ((format (printf, 2, 3)));
|
||||
extern int netdev_err(const struct net_device *dev, const char *format, ...)
|
||||
__attribute__ ((format (printf, 2, 3)));
|
||||
extern int netdev_warn(const struct net_device *dev, const char *format, ...)
|
||||
__attribute__ ((format (printf, 2, 3)));
|
||||
extern int netdev_notice(const struct net_device *dev, const char *format, ...)
|
||||
__attribute__ ((format (printf, 2, 3)));
|
||||
extern int netdev_info(const struct net_device *dev, const char *format, ...)
|
||||
__attribute__ ((format (printf, 2, 3)));
|
||||
extern __printf(3, 4)
|
||||
int netdev_printk(const char *level, const struct net_device *dev,
|
||||
const char *format, ...);
|
||||
extern __printf(2, 3)
|
||||
int netdev_emerg(const struct net_device *dev, const char *format, ...);
|
||||
extern __printf(2, 3)
|
||||
int netdev_alert(const struct net_device *dev, const char *format, ...);
|
||||
extern __printf(2, 3)
|
||||
int netdev_crit(const struct net_device *dev, const char *format, ...);
|
||||
extern __printf(2, 3)
|
||||
int netdev_err(const struct net_device *dev, const char *format, ...);
|
||||
extern __printf(2, 3)
|
||||
int netdev_warn(const struct net_device *dev, const char *format, ...);
|
||||
extern __printf(2, 3)
|
||||
int netdev_notice(const struct net_device *dev, const char *format, ...);
|
||||
extern __printf(2, 3)
|
||||
int netdev_info(const struct net_device *dev, const char *format, ...);
|
||||
|
||||
#define MODULE_ALIAS_NETDEV(device) \
|
||||
MODULE_ALIAS("netdev-" device)
|
||||
|
||||
@@ -82,22 +82,22 @@ struct va_format {
|
||||
* Dummy printk for disabled debugging statements to use whilst maintaining
|
||||
* gcc's format and side-effect checking.
|
||||
*/
|
||||
static inline __attribute__ ((format (printf, 1, 2)))
|
||||
static inline __printf(1, 2)
|
||||
int no_printk(const char *fmt, ...)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern asmlinkage __attribute__ ((format (printf, 1, 2)))
|
||||
extern asmlinkage __printf(1, 2)
|
||||
void early_printk(const char *fmt, ...);
|
||||
|
||||
extern int printk_needs_cpu(int cpu);
|
||||
extern void printk_tick(void);
|
||||
|
||||
#ifdef CONFIG_PRINTK
|
||||
asmlinkage __attribute__ ((format (printf, 1, 0)))
|
||||
asmlinkage __printf(1, 0)
|
||||
int vprintk(const char *fmt, va_list args);
|
||||
asmlinkage __attribute__ ((format (printf, 1, 2))) __cold
|
||||
asmlinkage __printf(1, 2) __cold
|
||||
int printk(const char *fmt, ...);
|
||||
|
||||
/*
|
||||
@@ -117,12 +117,12 @@ extern int kptr_restrict;
|
||||
void log_buf_kexec_setup(void);
|
||||
void __init setup_log_buf(int early);
|
||||
#else
|
||||
static inline __attribute__ ((format (printf, 1, 0)))
|
||||
static inline __printf(1, 0)
|
||||
int vprintk(const char *s, va_list args)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
static inline __attribute__ ((format (printf, 1, 2))) __cold
|
||||
static inline __printf(1, 2) __cold
|
||||
int printk(const char *s, ...)
|
||||
{
|
||||
return 0;
|
||||
|
||||
@@ -31,7 +31,7 @@ static inline bool is_quota_modification(struct inode *inode, struct iattr *ia)
|
||||
#define quota_error(sb, fmt, args...) \
|
||||
__quota_error((sb), __func__, fmt , ## args)
|
||||
|
||||
extern __attribute__((format (printf, 3, 4)))
|
||||
extern __printf(3, 4)
|
||||
void __quota_error(struct super_block *sb, const char *func,
|
||||
const char *fmt, ...);
|
||||
|
||||
|
||||
@@ -84,8 +84,7 @@ int seq_putc(struct seq_file *m, char c);
|
||||
int seq_puts(struct seq_file *m, const char *s);
|
||||
int seq_write(struct seq_file *seq, const void *data, size_t len);
|
||||
|
||||
int seq_printf(struct seq_file *, const char *, ...)
|
||||
__attribute__ ((format (printf,2,3)));
|
||||
__printf(2, 3) int seq_printf(struct seq_file *, const char *, ...);
|
||||
|
||||
int seq_path(struct seq_file *, struct path *, char *);
|
||||
int seq_dentry(struct seq_file *, struct dentry *, char *);
|
||||
|
||||
@@ -29,10 +29,10 @@ trace_seq_init(struct trace_seq *s)
|
||||
* Currently only defined when tracing is enabled.
|
||||
*/
|
||||
#ifdef CONFIG_TRACING
|
||||
extern int trace_seq_printf(struct trace_seq *s, const char *fmt, ...)
|
||||
__attribute__ ((format (printf, 2, 3)));
|
||||
extern int trace_seq_vprintf(struct trace_seq *s, const char *fmt, va_list args)
|
||||
__attribute__ ((format (printf, 2, 0)));
|
||||
extern __printf(2, 3)
|
||||
int trace_seq_printf(struct trace_seq *s, const char *fmt, ...);
|
||||
extern __printf(2, 0)
|
||||
int trace_seq_vprintf(struct trace_seq *s, const char *fmt, va_list args);
|
||||
extern int
|
||||
trace_seq_bprintf(struct trace_seq *s, const char *fmt, const u32 *binary);
|
||||
extern int trace_print_seq(struct seq_file *m, struct trace_seq *s);
|
||||
|
||||
Reference in New Issue
Block a user