From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: Samuel Zou <zou_wei@huawei.com>, <dan.j.williams@intel.com>,
<vkoul@kernel.org>
Cc: <dmaengine@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH -next] dmaengine: ti: k3-udma: Use PTR_ERR_OR_ZERO() to simplify code
Date: Thu, 14 May 2020 11:33:23 +0300 [thread overview]
Message-ID: <f9ae33c9-5a8a-d10a-5bb3-ecf9ee5d81f5@ti.com> (raw)
In-Reply-To: <1588757146-38858-1-git-send-email-zou_wei@huawei.com>
[-- Attachment #1: Type: text/plain, Size: 1999 bytes --]
Hi Samuel,
On 06/05/2020 12.25, Samuel Zou wrote:
> Fixes coccicheck warnings:
>
> drivers/dma/ti/k3-udma.c:1294:1-3: WARNING: PTR_ERR_OR_ZERO can be used
> drivers/dma/ti/k3-udma.c:1311:1-3: WARNING: PTR_ERR_OR_ZERO can be used
> drivers/dma/ti/k3-udma.c:1376:1-3: WARNING: PTR_ERR_OR_ZERO can be used
Thanks for the patch, I have missed it as I was not in CC for it.
scripts/get_maintainer.pl would have tipped for a wider recipient list..
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Samuel Zou <zou_wei@huawei.com>
> ---
> drivers/dma/ti/k3-udma.c | 12 +++---------
> 1 file changed, 3 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/dma/ti/k3-udma.c b/drivers/dma/ti/k3-udma.c
> index 0a04174..f5775ca 100644
> --- a/drivers/dma/ti/k3-udma.c
> +++ b/drivers/dma/ti/k3-udma.c
> @@ -1291,10 +1291,8 @@ static int udma_get_tchan(struct udma_chan *uc)
> }
>
> uc->tchan = __udma_reserve_tchan(ud, uc->config.channel_tpl, -1);
> - if (IS_ERR(uc->tchan))
> - return PTR_ERR(uc->tchan);
>
> - return 0;
> + return PTR_ERR_OR_ZERO(uc->tchan);
> }
>
> static int udma_get_rchan(struct udma_chan *uc)
> @@ -1308,10 +1306,8 @@ static int udma_get_rchan(struct udma_chan *uc)
> }
>
> uc->rchan = __udma_reserve_rchan(ud, uc->config.channel_tpl, -1);
> - if (IS_ERR(uc->rchan))
> - return PTR_ERR(uc->rchan);
>
> - return 0;
> + return PTR_ERR_OR_ZERO(uc->rchan);
> }
>
> static int udma_get_chan_pair(struct udma_chan *uc)
> @@ -1373,10 +1369,8 @@ static int udma_get_rflow(struct udma_chan *uc, int flow_id)
> }
>
> uc->rflow = __udma_get_rflow(ud, flow_id);
> - if (IS_ERR(uc->rflow))
> - return PTR_ERR(uc->rflow);
>
> - return 0;
> + return PTR_ERR_OR_ZERO(uc->rflow);
> }
>
> static void udma_put_rchan(struct udma_chan *uc)
>
- Péter
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
[-- Attachment #2: pEpkey.asc --]
[-- Type: application/pgp-keys, Size: 1783 bytes --]
next prev parent reply other threads:[~2020-05-14 8:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-06 9:25 [PATCH -next] dmaengine: ti: k3-udma: Use PTR_ERR_OR_ZERO() to simplify code Samuel Zou
2020-05-13 14:52 ` Vinod Koul
2020-05-14 8:33 ` Peter Ujfalusi [this message]
2020-05-14 9:09 ` Samuel Zou
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=f9ae33c9-5a8a-d10a-5bb3-ecf9ee5d81f5@ti.com \
--to=peter.ujfalusi@ti.com \
--cc=dan.j.williams@intel.com \
--cc=dmaengine@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=vkoul@kernel.org \
--cc=zou_wei@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).