Skip to content

Commit

Permalink
mips: mm: no need to check return value of debugfs_create functions
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Paul Burton <[email protected]>
Cc: James Hogan <[email protected]>
Cc: Andy Shevchenko <[email protected]>
Cc: [email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Paul Burton <[email protected]>
  • Loading branch information
gregkh authored and paulburton committed Jan 22, 2019
1 parent 4c90de4 commit 864cc36
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions arch/mips/mm/sc-debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,11 @@ static const struct file_operations sc_prefetch_fops = {

static int __init sc_debugfs_init(void)
{
struct dentry *dir, *file;

if (!mips_debugfs_dir)
return -ENODEV;
struct dentry *dir;

dir = debugfs_create_dir("l2cache", mips_debugfs_dir);
if (IS_ERR(dir))
return PTR_ERR(dir);

file = debugfs_create_file("prefetch", S_IRUGO | S_IWUSR, dir,
NULL, &sc_prefetch_fops);
if (!file)
return -ENOMEM;

debugfs_create_file("prefetch", S_IRUGO | S_IWUSR, dir, NULL,
&sc_prefetch_fops);
return 0;
}
late_initcall(sc_debugfs_init);

0 comments on commit 864cc36

Please sign in to comment.