Skip to content

Commit 225afca

Browse files
committed
vmw_balloon: 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: 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>
1 parent 993f5d1 commit 225afca

1 file changed

Lines changed: 3 additions & 16 deletions

File tree

‎drivers/misc/vmw_balloon.c‎

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1516,19 +1516,10 @@ static int vmballoon_debug_show(struct seq_file *f, void *offset)
15161516

15171517
DEFINE_SHOW_ATTRIBUTE(vmballoon_debug);
15181518

1519-
static int __init vmballoon_debugfs_init(struct vmballoon *b)
1519+
static void __init vmballoon_debugfs_init(struct vmballoon *b)
15201520
{
1521-
int error;
1522-
15231521
b->dbg_entry = debugfs_create_file("vmmemctl", S_IRUGO, NULL, b,
15241522
&vmballoon_debug_fops);
1525-
if (IS_ERR(b->dbg_entry)) {
1526-
error = PTR_ERR(b->dbg_entry);
1527-
pr_err("failed to create debugfs entry, error: %d\n", error);
1528-
return error;
1529-
}
1530-
1531-
return 0;
15321523
}
15331524

15341525
static void __exit vmballoon_debugfs_exit(struct vmballoon *b)
@@ -1541,9 +1532,8 @@ static void __exit vmballoon_debugfs_exit(struct vmballoon *b)
15411532

15421533
#else
15431534

1544-
static inline int vmballoon_debugfs_init(struct vmballoon *b)
1535+
static inline void vmballoon_debugfs_init(struct vmballoon *b)
15451536
{
1546-
return 0;
15471537
}
15481538

15491539
static inline void vmballoon_debugfs_exit(struct vmballoon *b)
@@ -1555,7 +1545,6 @@ static inline void vmballoon_debugfs_exit(struct vmballoon *b)
15551545
static int __init vmballoon_init(void)
15561546
{
15571547
enum vmballoon_page_size_type page_size;
1558-
int error;
15591548

15601549
/*
15611550
* Check if we are running on VMware's hypervisor and bail out
@@ -1571,9 +1560,7 @@ static int __init vmballoon_init(void)
15711560

15721561
INIT_DELAYED_WORK(&balloon.dwork, vmballoon_work);
15731562

1574-
error = vmballoon_debugfs_init(&balloon);
1575-
if (error)
1576-
return error;
1563+
vmballoon_debugfs_init(&balloon);
15771564

15781565
spin_lock_init(&balloon.comm_lock);
15791566
init_rwsem(&balloon.conf_sem);

0 commit comments

Comments
 (0)