[PATCH v4] iommu: remove redundant parameter check in tegra_smmu_debugfs_init()

Minjie Du posted 1 patch 2 years, 7 months ago
There is a newer version of this series
drivers/iommu/tegra-smmu.c | 2 --
1 file changed, 2 deletions(-)
[PATCH v4] iommu: remove redundant parameter check in tegra_smmu_debugfs_init()
Posted by Minjie Du 2 years, 7 months ago
debugfs_create_file() will return early if smmu->debugfs is an error
pointer, so an extra error check is not needed.

Signed-off-by: Minjie Du <duminjie@vivo.com>
Acked-by: Thierry Reding <treding@nvidia.com>
---
 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
Re: [PATCH v4] iommu: remove redundant parameter check in tegra_smmu_debugfs_init()
Posted by Baolu Lu 2 years, 7 months ago
On 2023/7/13 15:28, Minjie Du wrote:
> debugfs_create_file() will return early if smmu->debugfs is an error
> pointer, so an extra error check is not needed.
> 
> Signed-off-by: Minjie Du <duminjie@vivo.com>
> Acked-by: Thierry Reding <treding@nvidia.com>
> ---
>   drivers/iommu/tegra-smmu.c | 2 --
>   1 file changed, 2 deletions(-)

Next time when you send a new version of a patch, please don't forget to
add the change log after the tear line. This way, people can know how
the patch evolved into this way.

Best regards,
baolu

> 
> 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);
Re: [PATCH v4] iommu: remove redundant parameter check in tegra_smmu_debugfs_init()
Posted by Baolu Lu 2 years, 7 months ago
On 2023/7/13 15:28, Minjie Du wrote:
> debugfs_create_file() will return early if smmu->debugfs is an error
> pointer, so an extra error check is not needed.
> 
> Signed-off-by: Minjie Du<duminjie@vivo.com>
> Acked-by: Thierry Reding<treding@nvidia.com>

Greg keeps reminding that no error branch for debugfs, so

Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com>

Best regards,
baolu