Skip to content

Commit 864cc36

Browse files
gregkhpaulburton
authored andcommitted
mips: mm: 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: Ralf Baechle <ralf@linux-mips.org> Cc: Paul Burton <paul.burton@mips.com> Cc: James Hogan <jhogan@kernel.org> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Cc: linux-mips@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Paul Burton <paul.burton@mips.com>
1 parent 4c90de4 commit 864cc36

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

arch/mips/mm/sc-debugfs.c

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,20 +55,11 @@ static const struct file_operations sc_prefetch_fops = {
5555

5656
static int __init sc_debugfs_init(void)
5757
{
58-
struct dentry *dir, *file;
59-
60-
if (!mips_debugfs_dir)
61-
return -ENODEV;
58+
struct dentry *dir;
6259

6360
dir = debugfs_create_dir("l2cache", mips_debugfs_dir);
64-
if (IS_ERR(dir))
65-
return PTR_ERR(dir);
66-
67-
file = debugfs_create_file("prefetch", S_IRUGO | S_IWUSR, dir,
68-
NULL, &sc_prefetch_fops);
69-
if (!file)
70-
return -ENOMEM;
71-
61+
debugfs_create_file("prefetch", S_IRUGO | S_IWUSR, dir, NULL,
62+
&sc_prefetch_fops);
7263
return 0;
7364
}
7465
late_initcall(sc_debugfs_init);

0 commit comments

Comments
 (0)