Skip to contentSkip to conversation

iommu: remove redundant parameter check in tegra_smmu_debugfs_init()

PATCH Superseded Minjie Du 3 participants 9 messages Jul 13, 2023 – Jul 14, 2023

Subsystems (3)

v4 of 6 Superseded Latest is v6 →

lore
Share & tools
lore

Minjie Du

author
#0 lore raw

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

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

---
 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
#1 lore raw
Quoted 8 lines · Minjie Du

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

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

Quoted 14 lines
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);
author
#2 lore raw

Hi baolu!

Thanks for your suggestion!

You say:

Quoted 1 line

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.

Do I need to submit a new patch?

Regards,
Minjie
-----邮件原件-----
发件人: Baolu Lu <[email protected]>
发送时间: 2023年7月14日 10:31
收件人: 杜敏杰 <[email protected]>; Thierry Reding <[email protected]>; Krishna Reddy <[email protected]>; Joerg Roedel <[email protected]>; Will Deacon <[email protected]>; Robin Murphy <[email protected]>; Jonathan Hunter <[email protected]>; open list:TEGRA IOMMU DRIVERS <[email protected]>; open list:IOMMU SUBSYSTEM <[email protected]>; open list <[email protected]> 抄送: [email protected]; opensource.kernel <[email protected]>; Thierry Reding <[email protected]>
主题: Re: [PATCH v4] iommu: remove redundant parameter check in tegra_smmu_debugfs_init()

[Some people who received this message don't often get email from [email protected]. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]

Quoted 8 lines · Minjie Du

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

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

Quoted 14 lines
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);
#3 lore raw
Quoted 7 lines · 杜敏杰

Hi baolu!

Thanks for your suggestion!

You say:

Quoted 1 line

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.

Do I need to submit a new patch?

Oh no. Just a kind remind. :-)

Best regards,
baolu

author
#4 lore raw

Hi Baolu!

I will pay attention to this in future patch!
Thanks again!

regards,
Minjie

-----邮件原件-----
发件人: Baolu Lu <[email protected]>
发送时间: 2023年7月14日 10:51
收件人: 杜敏杰 <[email protected]>; Thierry Reding <[email protected]>; Krishna Reddy <[email protected]>; Joerg Roedel <[email protected]>; Will Deacon <[email protected]>; Robin Murphy <[email protected]>; Jonathan Hunter <[email protected]>; open list:TEGRA IOMMU DRIVERS <[email protected]>; open list:IOMMU SUBSYSTEM <[email protected]>; open list <[email protected]> 抄送: [email protected]; opensource.kernel <[email protected]>; Thierry Reding <[email protected]>
主题: Re: 回复: [PATCH v4] iommu: remove redundant parameter check in tegra_smmu_debugfs_init()

[You don't often get email from [email protected]. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]

Quoted 7 lines · 杜敏杰

Hi baolu!

Thanks for your suggestion!

You say:

Quoted 1 line

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.

Do I need to submit a new patch?

Oh no. Just a kind remind. :-)

Best regards,
baolu

author Reviewed-by Lu Baolu
#6 lore raw

Hi Baolu!

It seems that 'smmu->debugfs' check is still needed. Then I will modify the patch.
Thanks!

regards,
Minjie

-----邮件原件-----
发件人: Baolu Lu <[email protected]>
发送时间: 2023年7月14日 10:58
收件人: 杜敏杰 <[email protected]>; Thierry Reding <[email protected]>; Krishna Reddy <[email protected]>; Joerg Roedel <[email protected]>; Will Deacon <[email protected]>; Robin Murphy <[email protected]>; Jonathan Hunter <[email protected]>; open list:TEGRA IOMMU DRIVERS <[email protected]>; open list:IOMMU SUBSYSTEM <[email protected]>; open list <[email protected]> 抄送: [email protected]; opensource.kernel <[email protected]>; Thierry Reding <[email protected]>
主题: Re: [PATCH v4] iommu: remove redundant parameter check in tegra_smmu_debugfs_init()

[Some people who received this message don't often get email from [email protected]. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]

Quoted 5 lines · Minjie Du

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

Greg keeps reminding that no error branch for debugfs, so

Best regards,
baolu

#7 lore raw
Quoted 8 lines · 杜敏杰

Hi Baolu!

It seems that 'smmu->debugfs' check is still needed. Then I will modify the patch.
Thanks!

regards,
Minjie

Don't top-post, please. See Documentation/process/2.Process.rst and Documentation/process/submitting-patches.rst.

Also, how did you come to the above conclusion? Baolu said that Greg keeps reminding people that we shouldn't do error handling for debugfs and gave a Reviewed-by:, so why the 180?

Thierry

Quoted 22 lines

-----邮件原件-----
发件人: Baolu Lu <[email protected]>
发送时间: 2023年7月14日 10:58
收件人: 杜敏杰 <[email protected]>; Thierry Reding <[email protected]>; Krishna Reddy <[email protected]>; Joerg Roedel <[email protected]>; Will Deacon <[email protected]>; Robin Murphy <[email protected]>; Jonathan Hunter <[email protected]>; open list:TEGRA IOMMU DRIVERS <[email protected]>; open list:IOMMU SUBSYSTEM <[email protected]>; open list <[email protected]> 抄送: [email protected]; opensource.kernel <[email protected]>; Thierry Reding <[email protected]>
主题: Re: [PATCH v4] iommu: remove redundant parameter check in tegra_smmu_debugfs_init()

[Some people who received this message don't often get email from [email protected]. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]

Quoted 5 lines · Minjie Du

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

Greg keeps reminding that no error branch for debugfs, so

Best regards,
baolu

author
#8 lore raw

Hi Thierry!

I misunderstood what Baolu meant, sorry.
I will submit a new patch.
Thanks!

regards,
Minjie

-----邮件原件-----
发件人: Thierry Reding <[email protected]>
发送时间: 2023年7月14日 16:41
收件人: 杜敏杰 <[email protected]>
抄送: Baolu Lu <[email protected]>; Krishna Reddy <[email protected]>; Joerg Roedel <[email protected]>; Will Deacon <[email protected]>; Robin Murphy <[email protected]>; Jonathan Hunter <[email protected]>; open list:TEGRA IOMMU DRIVERS <[email protected]>; open list:IOMMU SUBSYSTEM <[email protected]>; open list <[email protected]>; opensource.kernel <[email protected]>; Thierry Reding <[email protected]> 主题: Re: 回复: [PATCH v4] iommu: remove redundant parameter check in tegra_smmu_debugfs_init()

Quoted 8 lines · 杜敏杰

Hi Baolu!

It seems that 'smmu->debugfs' check is still needed. Then I will modify the patch.
Thanks!

regards,
Minjie

Don't top-post, please. See Documentation/process/2.Process.rst and Documentation/process/submitting-patches.rst.

Also, how did you come to the above conclusion? Baolu said that Greg keeps reminding people that we shouldn't do error handling for debugfs and gave a Reviewed-by:, so why the 180?

Thierry

Quoted 32 lines

-----邮件原件-----
发件人: Baolu Lu <[email protected]>
发送时间: 2023年7月14日 10:58
收件人: 杜敏杰 <[email protected]>; Thierry Reding <[email protected]>; Krishna Reddy <[email protected]>; Joerg Roedel <[email protected]>; Will Deacon <[email protected]>; Robin Murphy <[email protected]>; Jonathan Hunter <[email protected]>; open list:TEGRA IOMMU DRIVERS <[email protected]>; open list:IOMMU SUBSYSTEM <[email protected]>; open list <[email protected]>
抄送: [email protected]; opensource.kernel <[email protected]>; Thierry Reding <[email protected]> 主题: Re: [PATCH v4] iommu: remove redundant parameter check in tegra_smmu_debugfs_init()

[Some people who received this message don't often get email from [email protected]. Learn why this is important at
https://aka.ms/LearnAboutSenderIdentification ]

Quoted 5 lines · Minjie Du

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

Greg keeps reminding that no error branch for debugfs, so

Best regards,
baolu