swiotlb: no need to check return value of debugfs_create functions
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 12 Jun 2019 14:43:14 +0000 (16:43 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Jul 2019 14:57:18 +0000 (16:57 +0200)
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: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Robin Murphy <robin.murphy@arm.com>
Cc: iommu@lists.linux-foundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20190612144314.GA16803@kroah.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/dma/swiotlb.c

index 13f0cb080a4dc960a1552ddb555155bb97c763f8..62fa5a82a0651de38fcd147f93a2b10e79f0bb4c 100644 (file)
@@ -696,29 +696,12 @@ bool is_swiotlb_active(void)
 
 static int __init swiotlb_create_debugfs(void)
 {
-       struct dentry *d_swiotlb_usage;
-       struct dentry *ent;
-
-       d_swiotlb_usage = debugfs_create_dir("swiotlb", NULL);
-
-       if (!d_swiotlb_usage)
-               return -ENOMEM;
-
-       ent = debugfs_create_ulong("io_tlb_nslabs", 0400,
-                                  d_swiotlb_usage, &io_tlb_nslabs);
-       if (!ent)
-               goto fail;
-
-       ent = debugfs_create_ulong("io_tlb_used", 0400,
-                                  d_swiotlb_usage, &io_tlb_used);
-       if (!ent)
-               goto fail;
+       struct dentry *root;
 
+       root = debugfs_create_dir("swiotlb", NULL);
+       debugfs_create_ulong("io_tlb_nslabs", 0400, root, &io_tlb_nslabs);
+       debugfs_create_ulong("io_tlb_used", 0400, root, &io_tlb_used);
        return 0;
-
-fail:
-       debugfs_remove_recursive(d_swiotlb_usage);
-       return -ENOMEM;
 }
 
 late_initcall(swiotlb_create_debugfs);