All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@ziepe.ca>
To: Baolu Lu <baolu.lu@linux.intel.com>
Cc: Jinjie Ruan <ruanjinjie@huawei.com>,
	linux-tegra@vger.kernel.org, iommu@lists.linux.dev,
	Thierry Reding <thierry.reding@gmail.com>,
	Krishna Reddy <vdumpa@nvidia.com>, Joerg Roedel <joro@8bytes.org>,
	Will Deacon <will@kernel.org>,
	Robin Murphy <robin.murphy@arm.com>,
	Jonathan Hunter <jonathanh@nvidia.com>
Subject: Re: [PATCH] iommu/tegra-smmu: Fix the NULL vs IS_ERR() bug for debugfs_create_dir()
Date: Wed, 6 Sep 2023 10:36:51 -0300	[thread overview]
Message-ID: <ZPiAc4MuNAJfnTaY@ziepe.ca> (raw)
In-Reply-To: <8830ecd1-f7a3-a708-66b1-2d9698d0d477@linux.intel.com>

On Fri, Sep 01, 2023 at 11:05:48AM +0800, Baolu Lu wrote:
> On 2023/8/31 20:38, Jinjie Ruan wrote:
> > The debugfs_create_dir() function returns error pointers.
> > It never returns NULL. So use IS_ERR() to check it.
> > 
> > Fixes: d1313e7896e9 ("iommu/tegra-smmu: Add debugfs support")
> > Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
> > ---
> >   drivers/iommu/tegra-smmu.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c
> > index e445f80d0226..cd1d80c4c673 100644
> > --- a/drivers/iommu/tegra-smmu.c
> > +++ b/drivers/iommu/tegra-smmu.c
> > @@ -1056,7 +1056,7 @@ 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)
> > +	if (IS_ERR(smmu->debugfs))
> >   		return;
> 
> There is no need to check the return value of debugfs_create_dir(). This
> change cannot fix anything as far as I can see. Just remove the
> check.

Right

Jason

      reply	other threads:[~2023-09-06 13:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-31 12:38 [PATCH] iommu/tegra-smmu: Fix the NULL vs IS_ERR() bug for debugfs_create_dir() Jinjie Ruan
2023-09-01  3:05 ` Baolu Lu
2023-09-06 13:36   ` Jason Gunthorpe [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZPiAc4MuNAJfnTaY@ziepe.ca \
    --to=jgg@ziepe.ca \
    --cc=baolu.lu@linux.intel.com \
    --cc=iommu@lists.linux.dev \
    --cc=jonathanh@nvidia.com \
    --cc=joro@8bytes.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=ruanjinjie@huawei.com \
    --cc=thierry.reding@gmail.com \
    --cc=vdumpa@nvidia.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.