All of lore.kernel.org
 help / color / mirror / Atom feed
From: Baolin Wang <baolin.wang@linaro.org>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Dan Williams <dan.j.williams@intel.com>,
	Vinod Koul <vkoul@kernel.org>, Orson Zhai <orsonzhai@gmail.com>,
	Chunyan Zhang <zhang.lyra@gmail.com>,
	dmaengine@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: dmaengine: sprd: fix an NULL vs IS_ERR() bug
Date: Wed, 16 May 2018 16:56:46 +0800	[thread overview]
Message-ID: <CAMz4kuJkWoO-m=4PK=TE_Zg8-ut2h-aMDZpgvYUUUkAqCx26jw@mail.gmail.com> (raw)

Hi Dan,

On 16 May 2018 at 16:48, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> We recently cleaned this code up but we need to update the error
> handling as well.  The devm_ioremap_resource() returns error pointers on
> error, never NULL.
>
> Fixes: e7f063ae1a31 ("dmaengine: sprd: Use devm_ioremap_resource() to map memory")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Thanks.
Reviewed-by: Baolin Wang <baolin.wang@linaro.org>

>
> diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c
> index e715d07aa632..36df3b096bbc 100644
> --- a/drivers/dma/sprd-dma.c
> +++ b/drivers/dma/sprd-dma.c
> @@ -808,8 +808,8 @@ static int sprd_dma_probe(struct platform_device *pdev)
>
>         res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>         sdev->glb_base = devm_ioremap_resource(&pdev->dev, res);
> -       if (!sdev->glb_base)
> -               return -ENOMEM;
> +       if (IS_ERR(sdev->glb_base))
> +               return PTR_ERR(sdev->glb_base);
>
>         dma_cap_set(DMA_MEMCPY, sdev->dma_dev.cap_mask);
>         sdev->total_chns = chn_count;

WARNING: multiple messages have this Message-ID (diff)
From: Baolin Wang <baolin.wang@linaro.org>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Dan Williams <dan.j.williams@intel.com>,
	Vinod Koul <vkoul@kernel.org>, Orson Zhai <orsonzhai@gmail.com>,
	Chunyan Zhang <zhang.lyra@gmail.com>,
	dmaengine@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] dmaengine: sprd: fix an NULL vs IS_ERR() bug
Date: Wed, 16 May 2018 08:56:46 +0000	[thread overview]
Message-ID: <CAMz4kuJkWoO-m=4PK=TE_Zg8-ut2h-aMDZpgvYUUUkAqCx26jw@mail.gmail.com> (raw)
In-Reply-To: <20180516084807.GA23043@mwanda>

Hi Dan,

On 16 May 2018 at 16:48, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> We recently cleaned this code up but we need to update the error
> handling as well.  The devm_ioremap_resource() returns error pointers on
> error, never NULL.
>
> Fixes: e7f063ae1a31 ("dmaengine: sprd: Use devm_ioremap_resource() to map memory")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Thanks.
Reviewed-by: Baolin Wang <baolin.wang@linaro.org>

>
> diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c
> index e715d07aa632..36df3b096bbc 100644
> --- a/drivers/dma/sprd-dma.c
> +++ b/drivers/dma/sprd-dma.c
> @@ -808,8 +808,8 @@ static int sprd_dma_probe(struct platform_device *pdev)
>
>         res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>         sdev->glb_base = devm_ioremap_resource(&pdev->dev, res);
> -       if (!sdev->glb_base)
> -               return -ENOMEM;
> +       if (IS_ERR(sdev->glb_base))
> +               return PTR_ERR(sdev->glb_base);
>
>         dma_cap_set(DMA_MEMCPY, sdev->dma_dev.cap_mask);
>         sdev->total_chns = chn_count;



-- 
Baolin.wang
Best Regards

             reply	other threads:[~2018-05-16  8:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-16  8:56 Baolin Wang [this message]
2018-05-16  8:56 ` [PATCH] dmaengine: sprd: fix an NULL vs IS_ERR() bug Baolin Wang
  -- strict thread matches above, loose matches on Subject: below --
2018-05-17  4:31 Vinod Koul
2018-05-17  4:43 ` [PATCH] " Vinod
2018-05-16  8:48 Dan Carpenter
2018-05-16  8:48 ` [PATCH] " Dan Carpenter

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='CAMz4kuJkWoO-m=4PK=TE_Zg8-ut2h-aMDZpgvYUUUkAqCx26jw@mail.gmail.com' \
    --to=baolin.wang@linaro.org \
    --cc=dan.carpenter@oracle.com \
    --cc=dan.j.williams@intel.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=orsonzhai@gmail.com \
    --cc=vkoul@kernel.org \
    --cc=zhang.lyra@gmail.com \
    /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.