Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

kobject: Add missing format attribute specifications

Several functions in <linux/kobject.h> accept printf-style arguments.
Some of these functions have been annotated with a format attribute
declaration while others have not been annotated. Add a format attribute
specification where it is missing.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Bart Van Assche and committed by
Greg Kroah-Hartman
9b99b7f8 d3f70bef

+5 -2
+5 -2
include/linux/kobject.h
··· 85 85 extern void kobject_init(struct kobject *kobj, struct kobj_type *ktype); 86 86 extern int __must_check kobject_add(struct kobject *kobj, 87 87 struct kobject *parent, 88 - const char *fmt, ...); 88 + const char *fmt, ...) 89 + __attribute__((format(printf, 3, 4))); 89 90 extern int __must_check kobject_init_and_add(struct kobject *kobj, 90 91 struct kobj_type *ktype, 91 92 struct kobject *parent, 92 - const char *fmt, ...); 93 + const char *fmt, ...) 94 + __attribute__((format(printf, 4, 5))); 93 95 94 96 extern void kobject_del(struct kobject *kobj); 95 97 ··· 228 226 229 227 static inline int add_uevent_var(struct kobj_uevent_env *env, 230 228 const char *format, ...) 229 + __attribute__((format(printf, 2, 3))) 231 230 { return 0; } 232 231 233 232 static inline int kobject_action_type(const char *buf, size_t count,