Skip to content

Commit 226a893

Browse files
gregkhMichal Simek
authored andcommitted
microblaze: 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: Michal Simek <monstr@monstr.eu> Cc: Rob Herring <robh@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
1 parent bfeffd1 commit 226a893

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

arch/microblaze/kernel/setup.c

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -192,23 +192,14 @@ struct dentry *of_debugfs_root;
192192
static int microblaze_debugfs_init(void)
193193
{
194194
of_debugfs_root = debugfs_create_dir("microblaze", NULL);
195-
196-
return of_debugfs_root == NULL;
195+
return 0;
197196
}
198197
arch_initcall(microblaze_debugfs_init);
199198

200199
# ifdef CONFIG_MMU
201200
static int __init debugfs_tlb(void)
202201
{
203-
struct dentry *d;
204-
205-
if (!of_debugfs_root)
206-
return -ENODEV;
207-
208-
d = debugfs_create_u32("tlb_skip", S_IRUGO, of_debugfs_root, &tlb_skip);
209-
if (!d)
210-
return -ENOMEM;
211-
202+
debugfs_create_u32("tlb_skip", S_IRUGO, of_debugfs_root, &tlb_skip);
212203
return 0;
213204
}
214205
device_initcall(debugfs_tlb);

0 commit comments

Comments
 (0)