lib: dynamic_debug: no need to check return value of debugfs_create functions
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 12 Jun 2019 15:35:34 +0000 (17:35 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 18 Jun 2019 11:47:24 +0000 (13:47 +0200)
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: linux-kernel@vger.kernel.org
Acked-by: Jason Baron <jbaron@akamai.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
lib/dynamic_debug.c

index 8a16c2d498e9d644ef863cef34225579d663c63c..c60409138e1367c57515bccbd62926915cf25a10 100644 (file)
@@ -993,20 +993,14 @@ static __initdata int ddebug_init_success;
 
 static int __init dynamic_debug_init_debugfs(void)
 {
-       struct dentry *dir, *file;
+       struct dentry *dir;
 
        if (!ddebug_init_success)
                return -ENODEV;
 
        dir = debugfs_create_dir("dynamic_debug", NULL);
-       if (!dir)
-               return -ENOMEM;
-       file = debugfs_create_file("control", 0644, dir, NULL,
-                                       &ddebug_proc_fops);
-       if (!file) {
-               debugfs_remove(dir);
-               return -ENOMEM;
-       }
+       debugfs_create_file("control", 0644, dir, NULL, &ddebug_proc_fops);
+
        return 0;
 }