Skip to content

Commit f7da9c0

Browse files
Jinjie Ruanjoergroedel
authored andcommitted
iommu/tegra-smmu: Drop unnecessary error check for for debugfs_create_dir()
The debugfs_create_dir() function returns error pointers. It never returns NULL. As Baolu suggested, this patch removes the error checking for debugfs_create_dir in tegra-smmu.c. This is because the DebugFS kernel API is developed in a way that the caller can safely ignore the errors that occur during the creation of DebugFS nodes. The debugfs APIs have a IS_ERR() judge in start_creating() which can handle it gracefully. So these checks are unnecessary. Fixes: d1313e7 ("iommu/tegra-smmu: Add debugfs support") Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com> Suggested-by: Baolu Lu <baolu.lu@linux.intel.com> Acked-by: Thierry Reding <treding@nvidia.com> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> Link: https://lore.kernel.org/r/20230901073056.1364755-1-ruanjinjie@huawei.com Signed-off-by: Joerg Roedel <jroedel@suse.de>
1 parent 6465e26 commit f7da9c0

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

drivers/iommu/tegra-smmu.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,8 +1056,6 @@ DEFINE_SHOW_ATTRIBUTE(tegra_smmu_clients);
10561056
static void tegra_smmu_debugfs_init(struct tegra_smmu *smmu)
10571057
{
10581058
smmu->debugfs = debugfs_create_dir("smmu", NULL);
1059-
if (!smmu->debugfs)
1060-
return;
10611059

10621060
debugfs_create_file("swgroups", S_IRUGO, smmu->debugfs, smmu,
10631061
&tegra_smmu_swgroups_fops);

0 commit comments

Comments
 (0)