aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/fault-inject.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/lib/fault-inject.c b/lib/fault-inject.c
index 23985a278bbb..a50a311554cc 100644
--- a/lib/fault-inject.c
+++ b/lib/fault-inject.c
@@ -134,23 +134,26 @@ bool should_fail(struct fault_attr *attr, ssize_t size)
134 134
135#ifdef CONFIG_FAULT_INJECTION_DEBUG_FS 135#ifdef CONFIG_FAULT_INJECTION_DEBUG_FS
136 136
137static void debugfs_ul_set(void *data, u64 val) 137static int debugfs_ul_set(void *data, u64 val)
138{ 138{
139 *(unsigned long *)data = val; 139 *(unsigned long *)data = val;
140 return 0;
140} 141}
141 142
142#ifdef CONFIG_FAULT_INJECTION_STACKTRACE_FILTER 143#ifdef CONFIG_FAULT_INJECTION_STACKTRACE_FILTER
143static void debugfs_ul_set_MAX_STACK_TRACE_DEPTH(void *data, u64 val) 144static int debugfs_ul_set_MAX_STACK_TRACE_DEPTH(void *data, u64 val)
144{ 145{
145 *(unsigned long *)data = 146 *(unsigned long *)data =
146 val < MAX_STACK_TRACE_DEPTH ? 147 val < MAX_STACK_TRACE_DEPTH ?
147 val : MAX_STACK_TRACE_DEPTH; 148 val : MAX_STACK_TRACE_DEPTH;
149 return 0;
148} 150}
149#endif /* CONFIG_FAULT_INJECTION_STACKTRACE_FILTER */ 151#endif /* CONFIG_FAULT_INJECTION_STACKTRACE_FILTER */
150 152
151static u64 debugfs_ul_get(void *data) 153static int debugfs_ul_get(void *data, u64 *val)
152{ 154{
153 return *(unsigned long *)data; 155 *val = *(unsigned long *)data;
156 return 0;
154} 157}
155 158
156DEFINE_SIMPLE_ATTRIBUTE(fops_ul, debugfs_ul_get, debugfs_ul_set, "%llu\n"); 159DEFINE_SIMPLE_ATTRIBUTE(fops_ul, debugfs_ul_get, debugfs_ul_set, "%llu\n");
@@ -174,14 +177,16 @@ static struct dentry *debugfs_create_ul_MAX_STACK_TRACE_DEPTH(
174} 177}
175#endif /* CONFIG_FAULT_INJECTION_STACKTRACE_FILTER */ 178#endif /* CONFIG_FAULT_INJECTION_STACKTRACE_FILTER */
176 179
177static void debugfs_atomic_t_set(void *data, u64 val) 180static int debugfs_atomic_t_set(void *data, u64 val)
178{ 181{
179 atomic_set((atomic_t *)data, val); 182 atomic_set((atomic_t *)data, val);
183 return 0;
180} 184}
181 185
182static u64 debugfs_atomic_t_get(void *data) 186static int debugfs_atomic_t_get(void *data, u64 *val)
183{ 187{
184 return atomic_read((atomic_t *)data); 188 *val = atomic_read((atomic_t *)data);
189 return 0;
185} 190}
186 191
187DEFINE_SIMPLE_ATTRIBUTE(fops_atomic_t, debugfs_atomic_t_get, 192DEFINE_SIMPLE_ATTRIBUTE(fops_atomic_t, debugfs_atomic_t_get,