Commit 03eb2a08 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

sh: 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: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Rich Felker <dalias@libc.org>
Cc: <linux-sh@vger.kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2fcc6e20
...@@ -9,9 +9,6 @@ EXPORT_SYMBOL(arch_debugfs_dir); ...@@ -9,9 +9,6 @@ EXPORT_SYMBOL(arch_debugfs_dir);
static int __init arch_kdebugfs_init(void) static int __init arch_kdebugfs_init(void)
{ {
arch_debugfs_dir = debugfs_create_dir("sh", NULL); arch_debugfs_dir = debugfs_create_dir("sh", NULL);
if (!arch_debugfs_dir)
return -ENOMEM;
return 0; return 0;
} }
arch_initcall(arch_kdebugfs_init); arch_initcall(arch_kdebugfs_init);
...@@ -63,13 +63,8 @@ static const struct file_operations asids_debugfs_fops = { ...@@ -63,13 +63,8 @@ static const struct file_operations asids_debugfs_fops = {
static int __init asids_debugfs_init(void) static int __init asids_debugfs_init(void)
{ {
struct dentry *asids_dentry; debugfs_create_file("asids", S_IRUSR, arch_debugfs_dir, NULL,
&asids_debugfs_fops);
asids_dentry = debugfs_create_file("asids", S_IRUSR, arch_debugfs_dir, return 0;
NULL, &asids_debugfs_fops);
if (!asids_dentry)
return -ENOMEM;
return PTR_ERR_OR_ZERO(asids_dentry);
} }
device_initcall(asids_debugfs_init); device_initcall(asids_debugfs_init);
...@@ -109,22 +109,10 @@ static const struct file_operations cache_debugfs_fops = { ...@@ -109,22 +109,10 @@ static const struct file_operations cache_debugfs_fops = {
static int __init cache_debugfs_init(void) static int __init cache_debugfs_init(void)
{ {
struct dentry *dcache_dentry, *icache_dentry; debugfs_create_file("dcache", S_IRUSR, arch_debugfs_dir,
(void *)CACHE_TYPE_DCACHE, &cache_debugfs_fops);
dcache_dentry = debugfs_create_file("dcache", S_IRUSR, arch_debugfs_dir, debugfs_create_file("icache", S_IRUSR, arch_debugfs_dir,
(unsigned int *)CACHE_TYPE_DCACHE, (void *)CACHE_TYPE_ICACHE, &cache_debugfs_fops);
&cache_debugfs_fops);
if (!dcache_dentry)
return -ENOMEM;
icache_dentry = debugfs_create_file("icache", S_IRUSR, arch_debugfs_dir,
(unsigned int *)CACHE_TYPE_ICACHE,
&cache_debugfs_fops);
if (!icache_dentry) {
debugfs_remove(dcache_dentry);
return -ENOMEM;
}
return 0; return 0;
} }
module_init(cache_debugfs_init); module_init(cache_debugfs_init);
......
...@@ -861,13 +861,8 @@ static const struct file_operations pmb_debugfs_fops = { ...@@ -861,13 +861,8 @@ static const struct file_operations pmb_debugfs_fops = {
static int __init pmb_debugfs_init(void) static int __init pmb_debugfs_init(void)
{ {
struct dentry *dentry; debugfs_create_file("pmb", S_IFREG | S_IRUGO, arch_debugfs_dir, NULL,
&pmb_debugfs_fops);
dentry = debugfs_create_file("pmb", S_IFREG | S_IRUGO,
arch_debugfs_dir, NULL, &pmb_debugfs_fops);
if (!dentry)
return -ENOMEM;
return 0; return 0;
} }
subsys_initcall(pmb_debugfs_init); subsys_initcall(pmb_debugfs_init);
......
...@@ -149,22 +149,10 @@ static const struct file_operations tlb_debugfs_fops = { ...@@ -149,22 +149,10 @@ static const struct file_operations tlb_debugfs_fops = {
static int __init tlb_debugfs_init(void) static int __init tlb_debugfs_init(void)
{ {
struct dentry *itlb, *utlb; debugfs_create_file("itlb", S_IRUSR, arch_debugfs_dir,
(void *)TLB_TYPE_ITLB, &tlb_debugfs_fops);
itlb = debugfs_create_file("itlb", S_IRUSR, arch_debugfs_dir, debugfs_create_file("utlb", S_IRUSR, arch_debugfs_dir,
(unsigned int *)TLB_TYPE_ITLB, (void *)TLB_TYPE_UTLB, &tlb_debugfs_fops);
&tlb_debugfs_fops);
if (unlikely(!itlb))
return -ENOMEM;
utlb = debugfs_create_file("utlb", S_IRUSR, arch_debugfs_dir,
(unsigned int *)TLB_TYPE_UTLB,
&tlb_debugfs_fops);
if (unlikely(!utlb)) {
debugfs_remove(itlb);
return -ENOMEM;
}
return 0; return 0;
} }
module_init(tlb_debugfs_init); module_init(tlb_debugfs_init);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment