Skip to contentSkip to conversation

irq: no need to check return value of debugfs_create functions

PATCH New Greg Kroah-Hartman 2 participants 2 messages Jan 22, 2019 – Jan 29, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 irq: 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 Thomas Gleixner <[email protected]>
Cc Marc Zyngier <[email protected]>
---
 kernel/irq/debugfs.c   | 2 --
 kernel/irq/irqdomain.c | 2 --
 2 files changed, 4 deletions(-)
kernel/irq/debugfs.c +0 -2
index 6f636136cccc..bbd783a83409 100644
@@ -256,8 +256,6 @@ static int __init irq_debugfs_init(void)
 	int irq;
 
 	root_dir = debugfs_create_dir("irq", NULL);
-	if (!root_dir)
-		return -ENOMEM;
 
 	irq_domain_debugfs_init(root_dir);
 
kernel/irq/irqdomain.c +0 -2
index 8b0be4bd6565..45c74373c7a4 100644
@@ -1749,8 +1749,6 @@ void __init irq_domain_debugfs_init(struct dentry *root)
 	struct irq_domain *d;
 
 	domain_dir = debugfs_create_dir("domains", root);
-	if (!domain_dir)
-		return;
 
 	debugfs_create_file("default", 0444, domain_dir, NULL,
 			    &irq_domain_debug_fops);
Signature · 1 line
2.20.1
#1 lore raw

[tip:irq/core] genirq/debugfs: No need to check return value of debugfs_create functions

genirq/debugfs: No need to check return value of debugfs_create functions
Commit-ID:  434537bbd50fefc89c1e29170bf4030ae3ec445a
Gitweb:     https://git.kernel.org/tip/434537bbd50fefc89c1e29170bf4030ae3ec445a
Author:     Greg Kroah-Hartman <[email protected]>
AuthorDate: Tue, 22 Jan 2019 16:21:49 +0100
Committer:  Thomas Gleixner <[email protected]>
CommitDate: Tue, 29 Jan 2019 20:04:21 +0100

genirq/debugfs: 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.

---
 kernel/irq/debugfs.c   | 2 --
 kernel/irq/irqdomain.c | 2 --
 2 files changed, 4 deletions(-)
kernel/irq/debugfs.c +0 -2
index 6f636136cccc..bbd783a83409 100644
@@ -256,8 +256,6 @@ static int __init irq_debugfs_init(void)
 	int irq;
 
 	root_dir = debugfs_create_dir("irq", NULL);
-	if (!root_dir)
-		return -ENOMEM;
 
 	irq_domain_debugfs_init(root_dir);
 
kernel/irq/irqdomain.c +0 -2
index 8b0be4bd6565..45c74373c7a4 100644
@@ -1749,8 +1749,6 @@ void __init irq_domain_debugfs_init(struct dentry *root)
 	struct irq_domain *d;
 
 	domain_dir = debugfs_create_dir("domains", root);
-	if (!domain_dir)
-		return;
 
 	debugfs_create_file("default", 0444, domain_dir, NULL,
 			    &irq_domain_debug_fops);