Skip to contentSkip to conversation

iommu: remove redundant parameter check in tegra_smmu_debugfs_init()

PATCH Superseded Minjie Du 3 participants 3 messages Jul 13, 2023

Subsystems (3)

v2 of 6 Superseded Latest is v6 →

lore
Share & tools
lore

Minjie Du

author
#0 lore raw

PATCH v2 1/1 iommu: remove redundant parameter check in tegra_smmu_debugfs_init()

debugfs_create_file() will simply return early if
smmu->debugfs is an error pointer.
Make smmu->debugfs check delete in tegra_smmu_debugfs_init().

---
 drivers/iommu/tegra-smmu.c | 2 --
 1 file changed, 2 deletions(-)
drivers/iommu/tegra-smmu.c +0 -2
index 1cbf063cc..2137040b7 100644
@@ -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);
Signature · 1 line
2.39.0
Acked-by on v2 1/1
#1 lore raw
Quoted 2 lines · Minjie Du

debugfs_create_file() will simply return early if
smmu->debugfs is an error pointer.

The formatting is a little weird here.

Quoted 1 line

Make smmu->debugfs check delete in tegra_smmu_debugfs_init().

I think something like this is better:

Delete smmu->debugfs check in ...

Or perhaps combine both sentences:

debugfs_create_file() will return early if smmu->debugfs is an error pointer, so an extra error check is not needed.

With that fixed:

#2 lore raw
Quoted 6 lines

debugfs_create_file() will return early if smmu->debugfs is an error pointer, so an extra error check is not needed.

With that fixed:

Are there any risks to consider with your presentation of this tag “in advance”?

I would also appreciate another improved imperative change description.

See also:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.5-rc1#n94

Would a subject like “[PATCH v3] iommu: Remove redundant error check in tegra_smmu_debugfs_init()” be more appropriate?

Regards,
Markus