diff options
author | Andrew Morton <akpm@osdl.org> | 2006-08-15 01:43:17 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-09-26 00:08:39 -0400 |
commit | 4a7fb6363f2d1a6c09a10253937f672f3c7929e1 (patch) | |
tree | 46e70fc8baca37ffd901c472ce7ce13338fb4ece /include/linux/sysfs.h | |
parent | 35acfdd7253025e8441883fd8f879f5240844f95 (diff) |
add __must_check to device management code
We're getting a lot of crashes in the sysfs/kobject/device/bus/class code and
they're very hard to diagnose.
I'm suspecting that in some cases this is because drivers aren't checking
return values and aren't handling errors correctly. So the code blithely
blunders on and crashes later in very obscure ways.
There's just no reason to ignore errors which can and do occur. So the patch
sprinkles __must_check all over these APIs.
Causes 1,513 new warnings. Heh.
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include/linux/sysfs.h')
-rw-r--r-- | include/linux/sysfs.h | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index 95f6db54d8d2..02ad790921fd 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h | |||
@@ -10,6 +10,7 @@ | |||
10 | #ifndef _SYSFS_H_ | 10 | #ifndef _SYSFS_H_ |
11 | #define _SYSFS_H_ | 11 | #define _SYSFS_H_ |
12 | 12 | ||
13 | #include <linux/compiler.h> | ||
13 | #include <asm/atomic.h> | 14 | #include <asm/atomic.h> |
14 | 15 | ||
15 | struct kobject; | 16 | struct kobject; |
@@ -86,37 +87,39 @@ struct sysfs_dirent { | |||
86 | 87 | ||
87 | #ifdef CONFIG_SYSFS | 88 | #ifdef CONFIG_SYSFS |
88 | 89 | ||
89 | extern int | 90 | extern int __must_check |
90 | sysfs_create_dir(struct kobject *); | 91 | sysfs_create_dir(struct kobject *); |
91 | 92 | ||
92 | extern void | 93 | extern void |
93 | sysfs_remove_dir(struct kobject *); | 94 | sysfs_remove_dir(struct kobject *); |
94 | 95 | ||
95 | extern int | 96 | extern int __must_check |
96 | sysfs_rename_dir(struct kobject *, const char *new_name); | 97 | sysfs_rename_dir(struct kobject *, const char *new_name); |
97 | 98 | ||
98 | extern int | 99 | extern int __must_check |
99 | sysfs_create_file(struct kobject *, const struct attribute *); | 100 | sysfs_create_file(struct kobject *, const struct attribute *); |
100 | 101 | ||
101 | extern int | 102 | extern int __must_check |
102 | sysfs_update_file(struct kobject *, const struct attribute *); | 103 | sysfs_update_file(struct kobject *, const struct attribute *); |
103 | 104 | ||
104 | extern int | 105 | extern int __must_check |
105 | sysfs_chmod_file(struct kobject *kobj, struct attribute *attr, mode_t mode); | 106 | sysfs_chmod_file(struct kobject *kobj, struct attribute *attr, mode_t mode); |
106 | 107 | ||
107 | extern void | 108 | extern void |
108 | sysfs_remove_file(struct kobject *, const struct attribute *); | 109 | sysfs_remove_file(struct kobject *, const struct attribute *); |
109 | 110 | ||
110 | extern int | 111 | extern int __must_check |
111 | sysfs_create_link(struct kobject * kobj, struct kobject * target, const char * name); | 112 | sysfs_create_link(struct kobject * kobj, struct kobject * target, const char * name); |
112 | 113 | ||
113 | extern void | 114 | extern void |
114 | sysfs_remove_link(struct kobject *, const char * name); | 115 | sysfs_remove_link(struct kobject *, const char * name); |
115 | 116 | ||
116 | int sysfs_create_bin_file(struct kobject * kobj, struct bin_attribute * attr); | 117 | int __must_check sysfs_create_bin_file(struct kobject *kobj, |
118 | struct bin_attribute *attr); | ||
117 | void sysfs_remove_bin_file(struct kobject *kobj, struct bin_attribute *attr); | 119 | void sysfs_remove_bin_file(struct kobject *kobj, struct bin_attribute *attr); |
118 | 120 | ||
119 | int sysfs_create_group(struct kobject *, const struct attribute_group *); | 121 | int __must_check sysfs_create_group(struct kobject *, |
122 | const struct attribute_group *); | ||
120 | void sysfs_remove_group(struct kobject *, const struct attribute_group *); | 123 | void sysfs_remove_group(struct kobject *, const struct attribute_group *); |
121 | void sysfs_notify(struct kobject * k, char *dir, char *attr); | 124 | void sysfs_notify(struct kobject * k, char *dir, char *attr); |
122 | 125 | ||