Skip to content

Commit

Permalink
x86: xen: 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: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: <x86@kernel.org>
Cc: <xen-devel@lists.xenproject.org>
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Greg Kroah-Hartman committed Jun 3, 2019
1 parent 2d146b9 commit ad09137
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
7 changes: 1 addition & 6 deletions arch/x86/xen/debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,8 @@ static struct dentry *d_xen_debug;

struct dentry * __init xen_init_debugfs(void)
{
if (!d_xen_debug) {
if (!d_xen_debug)
d_xen_debug = debugfs_create_dir("xen", NULL);

if (!d_xen_debug)
pr_warning("Could not create 'xen' debugfs directory\n");
}

return d_xen_debug;
}

3 changes: 0 additions & 3 deletions arch/x86/xen/p2m.c
Original file line number Diff line number Diff line change
Expand Up @@ -817,9 +817,6 @@ static int __init xen_p2m_debugfs(void)
{
struct dentry *d_xen = xen_init_debugfs();

if (d_xen == NULL)
return -ENOMEM;

d_mmu_debug = debugfs_create_dir("mmu", d_xen);

debugfs_create_file("p2m", 0600, d_mmu_debug, NULL, &p2m_dump_fops);
Expand Down

0 comments on commit ad09137

Please sign in to comment.