iommu/tegra-smmu: drop error checking for debugfs_create_dir()
Subsystems (3)
PATCH v2 1/1 iommu/tegra-smmu: drop error checking for debugfs_create_dir()
The return value of debugfs_create_dir() should be checked using the IS_ERR() function. The patch, however, drops the check statement without fixing it because the subsequent functions (i. e. debugfs_create_file()) can handle the case where @parent is an error pointer.
---
Changes in v2:
- drop the error checking statement
drivers/iommu/tegra-smmu.c | 3 --- 1 file changed, 3 deletions(-)
drivers/iommu/tegra-smmu.c +0 -3
@@ -1056,9 +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); debugfs_create_file("clients", S_IRUGO, smmu->debugfs, smmu,
Signature · 1 line
2.42.0
Joerg Roedel
maintainerQuoted 4 lines · Dario Binacchi
The return value of
debugfs_create_dir()should be checked using theIS_ERR()function. The patch, however, drops the check statement without fixing it because the subsequent functions (i. e.debugfs_create_file()) can handle the case where@parentis an error pointer.
This deserves a comment in the code explaining why no error checking is needed.
Regards,
Joerg
Quoted 8 lines · Joerg Roedel
Quoted 4 lines · Dario Binacchi
The return value of
debugfs_create_dir()should be checked using theIS_ERR()function. The patch, however, drops the check statement without fixing it because the subsequent functions (i. e.debugfs_create_file()) can handle the case where@parentis an error pointer.This deserves a comment in the code explaining why no error checking is needed.
This is a duplicate of f7da9c081517 ("iommu/tegra-smmu: Drop unnecessary error check for for debugfs_create_dir()"), which is already in v6.7-rc1 so I think we can ignore this one.
Thierry