2023-07-13 03:11:54

by Minjie Du

[permalink] [raw]
Subject: [PATCH v2] 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().

Signed-off-by: Minjie Du <[email protected]>
---
drivers/iommu/tegra-smmu.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c
index 1cbf063cc..2137040b7 100644
--- a/drivers/iommu/tegra-smmu.c
+++ b/drivers/iommu/tegra-smmu.c
@@ -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);
--
2.39.0



2023-07-13 07:22:21

by Thierry Reding

[permalink] [raw]
Subject: Re: [PATCH v2] iommu: remove redundant parameter check in tegra_smmu_debugfs_init()

On Thu, Jul 13, 2023 at 10:56:53AM +0800, Minjie Du wrote:
> debugfs_create_file() will simply return early if
> smmu->debugfs is an error pointer.

The formatting is a little weird here.

> 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:

Acked-by: Thierry Reding <[email protected]>


Attachments:
(No filename) (574.00 B)
signature.asc (849.00 B)
Download all attachments