diff options
Diffstat (limited to 'fs/debugfs/file.c')
-rw-r--r-- | fs/debugfs/file.c | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/fs/debugfs/file.c b/fs/debugfs/file.c index fa6b7f7ff914..fddffe4851f5 100644 --- a/fs/debugfs/file.c +++ b/fs/debugfs/file.c | |||
@@ -56,13 +56,15 @@ const struct inode_operations debugfs_link_operations = { | |||
56 | .follow_link = debugfs_follow_link, | 56 | .follow_link = debugfs_follow_link, |
57 | }; | 57 | }; |
58 | 58 | ||
59 | static void debugfs_u8_set(void *data, u64 val) | 59 | static int debugfs_u8_set(void *data, u64 val) |
60 | { | 60 | { |
61 | *(u8 *)data = val; | 61 | *(u8 *)data = val; |
62 | return 0; | ||
62 | } | 63 | } |
63 | static u64 debugfs_u8_get(void *data) | 64 | static int debugfs_u8_get(void *data, u64 *val) |
64 | { | 65 | { |
65 | return *(u8 *)data; | 66 | *val = *(u8 *)data; |
67 | return 0; | ||
66 | } | 68 | } |
67 | DEFINE_SIMPLE_ATTRIBUTE(fops_u8, debugfs_u8_get, debugfs_u8_set, "%llu\n"); | 69 | DEFINE_SIMPLE_ATTRIBUTE(fops_u8, debugfs_u8_get, debugfs_u8_set, "%llu\n"); |
68 | 70 | ||
@@ -97,13 +99,15 @@ struct dentry *debugfs_create_u8(const char *name, mode_t mode, | |||
97 | } | 99 | } |
98 | EXPORT_SYMBOL_GPL(debugfs_create_u8); | 100 | EXPORT_SYMBOL_GPL(debugfs_create_u8); |
99 | 101 | ||
100 | static void debugfs_u16_set(void *data, u64 val) | 102 | static int debugfs_u16_set(void *data, u64 val) |
101 | { | 103 | { |
102 | *(u16 *)data = val; | 104 | *(u16 *)data = val; |
105 | return 0; | ||
103 | } | 106 | } |
104 | static u64 debugfs_u16_get(void *data) | 107 | static int debugfs_u16_get(void *data, u64 *val) |
105 | { | 108 | { |
106 | return *(u16 *)data; | 109 | *val = *(u16 *)data; |
110 | return 0; | ||
107 | } | 111 | } |
108 | DEFINE_SIMPLE_ATTRIBUTE(fops_u16, debugfs_u16_get, debugfs_u16_set, "%llu\n"); | 112 | DEFINE_SIMPLE_ATTRIBUTE(fops_u16, debugfs_u16_get, debugfs_u16_set, "%llu\n"); |
109 | 113 | ||
@@ -138,13 +142,15 @@ struct dentry *debugfs_create_u16(const char *name, mode_t mode, | |||
138 | } | 142 | } |
139 | EXPORT_SYMBOL_GPL(debugfs_create_u16); | 143 | EXPORT_SYMBOL_GPL(debugfs_create_u16); |
140 | 144 | ||
141 | static void debugfs_u32_set(void *data, u64 val) | 145 | static int debugfs_u32_set(void *data, u64 val) |
142 | { | 146 | { |
143 | *(u32 *)data = val; | 147 | *(u32 *)data = val; |
148 | return 0; | ||
144 | } | 149 | } |
145 | static u64 debugfs_u32_get(void *data) | 150 | static int debugfs_u32_get(void *data, u64 *val) |
146 | { | 151 | { |
147 | return *(u32 *)data; | 152 | *val = *(u32 *)data; |
153 | return 0; | ||
148 | } | 154 | } |
149 | DEFINE_SIMPLE_ATTRIBUTE(fops_u32, debugfs_u32_get, debugfs_u32_set, "%llu\n"); | 155 | DEFINE_SIMPLE_ATTRIBUTE(fops_u32, debugfs_u32_get, debugfs_u32_set, "%llu\n"); |
150 | 156 | ||
@@ -179,14 +185,16 @@ struct dentry *debugfs_create_u32(const char *name, mode_t mode, | |||
179 | } | 185 | } |
180 | EXPORT_SYMBOL_GPL(debugfs_create_u32); | 186 | EXPORT_SYMBOL_GPL(debugfs_create_u32); |
181 | 187 | ||
182 | static void debugfs_u64_set(void *data, u64 val) | 188 | static int debugfs_u64_set(void *data, u64 val) |
183 | { | 189 | { |
184 | *(u64 *)data = val; | 190 | *(u64 *)data = val; |
191 | return 0; | ||
185 | } | 192 | } |
186 | 193 | ||
187 | static u64 debugfs_u64_get(void *data) | 194 | static int debugfs_u64_get(void *data, u64 *val) |
188 | { | 195 | { |
189 | return *(u64 *)data; | 196 | *val = *(u64 *)data; |
197 | return 0; | ||
190 | } | 198 | } |
191 | DEFINE_SIMPLE_ATTRIBUTE(fops_u64, debugfs_u64_get, debugfs_u64_set, "%llu\n"); | 199 | DEFINE_SIMPLE_ATTRIBUTE(fops_u64, debugfs_u64_get, debugfs_u64_set, "%llu\n"); |
192 | 200 | ||