]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
microblaze: no need to check return value of debugfs_create functions
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Jan 2019 16:45:58 +0000 (17:45 +0100)
committerMichal Simek <michal.simek@xilinx.com>
Mon, 14 Jan 2019 09:22:16 +0000 (10:22 +0100)
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>
arch/microblaze/kernel/setup.c

index bbd6968ce55b5fbaec58f1fef21bdfd17826f779..522a0c5d9c59c47fc33b76378d1be5cd4bec44c8 100644 (file)
@@ -192,23 +192,14 @@ struct dentry *of_debugfs_root;
 static int microblaze_debugfs_init(void)
 {
        of_debugfs_root = debugfs_create_dir("microblaze", NULL);
-
-       return of_debugfs_root == NULL;
+       return 0;
 }
 arch_initcall(microblaze_debugfs_init);
 
 # ifdef CONFIG_MMU
 static int __init debugfs_tlb(void)
 {
-       struct dentry *d;
-
-       if (!of_debugfs_root)
-               return -ENODEV;
-
-       d = debugfs_create_u32("tlb_skip", S_IRUGO, of_debugfs_root, &tlb_skip);
-       if (!d)
-               return -ENOMEM;
-
+       debugfs_create_u32("tlb_skip", S_IRUGO, of_debugfs_root, &tlb_skip);
        return 0;
 }
 device_initcall(debugfs_tlb);