aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sysfs.h
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2006-08-15 01:43:17 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2006-09-26 00:08:39 -0400
commit4a7fb6363f2d1a6c09a10253937f672f3c7929e1 (patch)
tree46e70fc8baca37ffd901c472ce7ce13338fb4ece /include/linux/sysfs.h
parent35acfdd7253025e8441883fd8f879f5240844f95 (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.h19
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
15struct kobject; 16struct kobject;
@@ -86,37 +87,39 @@ struct sysfs_dirent {
86 87
87#ifdef CONFIG_SYSFS 88#ifdef CONFIG_SYSFS
88 89
89extern int 90extern int __must_check
90sysfs_create_dir(struct kobject *); 91sysfs_create_dir(struct kobject *);
91 92
92extern void 93extern void
93sysfs_remove_dir(struct kobject *); 94sysfs_remove_dir(struct kobject *);
94 95
95extern int 96extern int __must_check
96sysfs_rename_dir(struct kobject *, const char *new_name); 97sysfs_rename_dir(struct kobject *, const char *new_name);
97 98
98extern int 99extern int __must_check
99sysfs_create_file(struct kobject *, const struct attribute *); 100sysfs_create_file(struct kobject *, const struct attribute *);
100 101
101extern int 102extern int __must_check
102sysfs_update_file(struct kobject *, const struct attribute *); 103sysfs_update_file(struct kobject *, const struct attribute *);
103 104
104extern int 105extern int __must_check
105sysfs_chmod_file(struct kobject *kobj, struct attribute *attr, mode_t mode); 106sysfs_chmod_file(struct kobject *kobj, struct attribute *attr, mode_t mode);
106 107
107extern void 108extern void
108sysfs_remove_file(struct kobject *, const struct attribute *); 109sysfs_remove_file(struct kobject *, const struct attribute *);
109 110
110extern int 111extern int __must_check
111sysfs_create_link(struct kobject * kobj, struct kobject * target, const char * name); 112sysfs_create_link(struct kobject * kobj, struct kobject * target, const char * name);
112 113
113extern void 114extern void
114sysfs_remove_link(struct kobject *, const char * name); 115sysfs_remove_link(struct kobject *, const char * name);
115 116
116int sysfs_create_bin_file(struct kobject * kobj, struct bin_attribute * attr); 117int __must_check sysfs_create_bin_file(struct kobject *kobj,
118 struct bin_attribute *attr);
117void sysfs_remove_bin_file(struct kobject *kobj, struct bin_attribute *attr); 119void sysfs_remove_bin_file(struct kobject *kobj, struct bin_attribute *attr);
118 120
119int sysfs_create_group(struct kobject *, const struct attribute_group *); 121int __must_check sysfs_create_group(struct kobject *,
122 const struct attribute_group *);
120void sysfs_remove_group(struct kobject *, const struct attribute_group *); 123void sysfs_remove_group(struct kobject *, const struct attribute_group *);
121void sysfs_notify(struct kobject * k, char *dir, char *attr); 124void sysfs_notify(struct kobject * k, char *dir, char *attr);
122 125