vmw_balloon: no need to check return value of debugfs_create functions
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Jun 2019 18:55:28 +0000 (20:55 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 12 Jun 2019 11:37:03 +0000 (13:37 +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: Julien Freche <jfreche@vmware.com>
Cc: "VMware, Inc." <pv-drivers@vmware.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: linux-kernel@vger.kernel.org
Acked-by: Nadav Amit <namit@vmware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/vmw_balloon.c

index ad807d5a314109fb813bf911ad9ee882444d7b5b..fdf5ad757226ebbda3c819e2295b6f3f70beed9c 100644 (file)
@@ -1516,19 +1516,10 @@ static int vmballoon_debug_show(struct seq_file *f, void *offset)
 
 DEFINE_SHOW_ATTRIBUTE(vmballoon_debug);
 
-static int __init vmballoon_debugfs_init(struct vmballoon *b)
+static void __init vmballoon_debugfs_init(struct vmballoon *b)
 {
-       int error;
-
        b->dbg_entry = debugfs_create_file("vmmemctl", S_IRUGO, NULL, b,
                                           &vmballoon_debug_fops);
-       if (IS_ERR(b->dbg_entry)) {
-               error = PTR_ERR(b->dbg_entry);
-               pr_err("failed to create debugfs entry, error: %d\n", error);
-               return error;
-       }
-
-       return 0;
 }
 
 static void __exit vmballoon_debugfs_exit(struct vmballoon *b)
@@ -1541,9 +1532,8 @@ static void __exit vmballoon_debugfs_exit(struct vmballoon *b)
 
 #else
 
-static inline int vmballoon_debugfs_init(struct vmballoon *b)
+static inline void vmballoon_debugfs_init(struct vmballoon *b)
 {
-       return 0;
 }
 
 static inline void vmballoon_debugfs_exit(struct vmballoon *b)
@@ -1555,7 +1545,6 @@ static inline void vmballoon_debugfs_exit(struct vmballoon *b)
 static int __init vmballoon_init(void)
 {
        enum vmballoon_page_size_type page_size;
-       int error;
 
        /*
         * Check if we are running on VMware's hypervisor and bail out
@@ -1571,9 +1560,7 @@ static int __init vmballoon_init(void)
 
        INIT_DELAYED_WORK(&balloon.dwork, vmballoon_work);
 
-       error = vmballoon_debugfs_init(&balloon);
-       if (error)
-               return error;
+       vmballoon_debugfs_init(&balloon);
 
        spin_lock_init(&balloon.comm_lock);
        init_rwsem(&balloon.conf_sem);