]> Git Repo - linux.git/commitdiff
iommu/tegra-smmu: Drop unnecessary error check for for debugfs_create_dir()
authorJinjie Ruan <[email protected]>
Fri, 1 Sep 2023 07:30:56 +0000 (15:30 +0800)
committerJoerg Roedel <[email protected]>
Mon, 25 Sep 2023 10:42:02 +0000 (12:42 +0200)
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: d1313e7896e9 ("iommu/tegra-smmu: Add debugfs support")
Signed-off-by: Jinjie Ruan <[email protected]>
Suggested-by: Baolu Lu <[email protected]>
Acked-by: Thierry Reding <[email protected]>
Reviewed-by: Jason Gunthorpe <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Joerg Roedel <[email protected]>
drivers/iommu/tegra-smmu.c

index e445f80d02263b405f9ed9a8218418dd6c9585a5..0060609c0673d18315310873de1e850c2c8cc467 100644 (file)
@@ -1056,8 +1056,6 @@ DEFINE_SHOW_ATTRIBUTE(tegra_smmu_clients);
 static void tegra_smmu_debugfs_init(struct tegra_smmu *smmu)
 {
        smmu->debugfs = debugfs_create_dir("smmu", NULL);
-       if (!smmu->debugfs)
-               return;
 
        debugfs_create_file("swgroups", S_IRUGO, smmu->debugfs, smmu,
                            &tegra_smmu_swgroups_fops);
This page took 0.056601 seconds and 4 git commands to generate.