Skip to content

Commit ef9d5a6

Browse files
gregkhpaulburton
authored andcommitted
mips: math-emu: no need to check return value of debugfs_create functions
When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this. Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Paul Burton <paul.burton@mips.com> Cc: James Hogan <jhogan@kernel.org> Cc: Yangtao Li <tiny.windzz@gmail.com> Cc: linux-mips@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Paul Burton <paul.burton@mips.com>
1 parent 864cc36 commit ef9d5a6

File tree

1 file changed

+4
-19
lines changed

1 file changed

+4
-19
lines changed

arch/mips/math-emu/me-debugfs.c

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -189,32 +189,21 @@ static int __init debugfs_fpuemu(void)
189189
{
190190
struct dentry *fpuemu_debugfs_base_dir;
191191
struct dentry *fpuemu_debugfs_inst_dir;
192-
struct dentry *d, *reset_file;
193-
194-
if (!mips_debugfs_dir)
195-
return -ENODEV;
196192

197193
fpuemu_debugfs_base_dir = debugfs_create_dir("fpuemustats",
198194
mips_debugfs_dir);
199-
if (!fpuemu_debugfs_base_dir)
200-
return -ENOMEM;
201195

202-
reset_file = debugfs_create_file("fpuemustats_clear", 0444,
203-
mips_debugfs_dir, NULL,
204-
&fpuemustats_clear_fops);
205-
if (!reset_file)
206-
return -ENOMEM;
196+
debugfs_create_file("fpuemustats_clear", 0444, mips_debugfs_dir, NULL,
197+
&fpuemustats_clear_fops);
207198

208199
#define FPU_EMU_STAT_OFFSET(m) \
209200
offsetof(struct mips_fpu_emulator_stats, m)
210201

211202
#define FPU_STAT_CREATE(m) \
212203
do { \
213-
d = debugfs_create_file(#m, 0444, fpuemu_debugfs_base_dir, \
204+
debugfs_create_file(#m, 0444, fpuemu_debugfs_base_dir, \
214205
(void *)FPU_EMU_STAT_OFFSET(m), \
215206
&fops_fpuemu_stat); \
216-
if (!d) \
217-
return -ENOMEM; \
218207
} while (0)
219208

220209
FPU_STAT_CREATE(emulated);
@@ -233,20 +222,16 @@ do { \
233222

234223
fpuemu_debugfs_inst_dir = debugfs_create_dir("instructions",
235224
fpuemu_debugfs_base_dir);
236-
if (!fpuemu_debugfs_inst_dir)
237-
return -ENOMEM;
238225

239226
#define FPU_STAT_CREATE_EX(m) \
240227
do { \
241228
char name[32]; \
242229
\
243230
adjust_instruction_counter_name(name, #m); \
244231
\
245-
d = debugfs_create_file(name, 0444, fpuemu_debugfs_inst_dir, \
232+
debugfs_create_file(name, 0444, fpuemu_debugfs_inst_dir, \
246233
(void *)FPU_EMU_STAT_OFFSET(m), \
247234
&fops_fpuemu_stat); \
248-
if (!d) \
249-
return -ENOMEM; \
250235
} while (0)
251236

252237
FPU_STAT_CREATE_EX(abs_s);

0 commit comments

Comments
 (0)