2020-01-20 13:05:33

by chenzhou

[permalink] [raw]
Subject: [PATCH -next] dmaengine: fsl-qdma: fix duplicated argument to &&

There is duplicated argument to && in function fsl_qdma_free_chan_resources,
which looks like a typo, pointer fsl_queue->desc_pool also needs NULL check,
fix it.
Detected with coccinelle.

Fixes: b092529e0aa0 ("dmaengine: fsl-qdma: Add qDMA controller driver for Layerscape SoCs")
Signed-off-by: Chen Zhou <[email protected]>
---
drivers/dma/fsl-qdma.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dma/fsl-qdma.c b/drivers/dma/fsl-qdma.c
index 8979208..95cc025 100644
--- a/drivers/dma/fsl-qdma.c
+++ b/drivers/dma/fsl-qdma.c
@@ -304,7 +304,7 @@ static void fsl_qdma_free_chan_resources(struct dma_chan *chan)

vchan_dma_desc_free_list(&fsl_chan->vchan, &head);

- if (!fsl_queue->comp_pool && !fsl_queue->comp_pool)
+ if (!fsl_queue->comp_pool && !fsl_queue->desc_pool)
return;

list_for_each_entry_safe(comp_temp, _comp_temp,
--
2.7.4


2020-01-21 02:56:15

by Peng Ma

[permalink] [raw]
Subject: RE: [PATCH -next] dmaengine: fsl-qdma: fix duplicated argument to &&



>-----Original Message-----
>From: Chen Zhou <[email protected]>
>Sent: 2020??1??20?? 20:59
>To: [email protected]; [email protected]
>Cc: Peng Ma <[email protected]>; Wen He <[email protected]>;
>[email protected]; [email protected];
>[email protected]; [email protected]
>Subject: [PATCH -next] dmaengine: fsl-qdma: fix duplicated argument to &&
>
>There is duplicated argument to && in function fsl_qdma_free_chan_resources,
>which looks like a typo, pointer fsl_queue->desc_pool also needs NULL check,
>fix it.
>Detected with coccinelle.
>
What does the " coccinelle " mean here?

>Fixes: b092529e0aa0 ("dmaengine: fsl-qdma: Add qDMA controller driver for
>Layerscape SoCs")
>Signed-off-by: Chen Zhou <[email protected]>
>---
> drivers/dma/fsl-qdma.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/drivers/dma/fsl-qdma.c b/drivers/dma/fsl-qdma.c index
>8979208..95cc025 100644
>--- a/drivers/dma/fsl-qdma.c
>+++ b/drivers/dma/fsl-qdma.c
>@@ -304,7 +304,7 @@ static void fsl_qdma_free_chan_resources(struct
>dma_chan *chan)
>
> vchan_dma_desc_free_list(&fsl_chan->vchan, &head);
>
>- if (!fsl_queue->comp_pool && !fsl_queue->comp_pool)
>+ if (!fsl_queue->comp_pool && !fsl_queue->desc_pool)
> return;
>
Hi Chen,

Thanks very much for your patch, It is really need to check comp_pool and desc_pool here.
Reviewed-by: Peng Ma <[email protected]>
Tested-by: Peng Ma <[email protected]>

BR,
Peng
> list_for_each_entry_safe(comp_temp, _comp_temp,
>--
>2.7.4

2020-01-21 03:29:52

by chenzhou

[permalink] [raw]
Subject: Re: [PATCH -next] dmaengine: fsl-qdma: fix duplicated argument to &&

Hi Peng,

On 2020/1/21 10:54, Peng Ma wrote:
>
>
>> -----Original Message-----
>> From: Chen Zhou <[email protected]>
>> Sent: 2020??1??20?? 20:59
>> To: [email protected]; [email protected]
>> Cc: Peng Ma <[email protected]>; Wen He <[email protected]>;
>> [email protected]; [email protected];
>> [email protected]; [email protected]
>> Subject: [PATCH -next] dmaengine: fsl-qdma: fix duplicated argument to &&
>>
>> There is duplicated argument to && in function fsl_qdma_free_chan_resources,
>> which looks like a typo, pointer fsl_queue->desc_pool also needs NULL check,
>> fix it.
>> Detected with coccinelle.
>>
> What does the " coccinelle " mean here?

The scripts in kernel dir, that is coccicheck.

Thanks,
Chen Zhou

>
>> Fixes: b092529e0aa0 ("dmaengine: fsl-qdma: Add qDMA controller driver for
>> Layerscape SoCs")
>> Signed-off-by: Chen Zhou <[email protected]>
>> ---
>> drivers/dma/fsl-qdma.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/dma/fsl-qdma.c b/drivers/dma/fsl-qdma.c index
>> 8979208..95cc025 100644
>> --- a/drivers/dma/fsl-qdma.c
>> +++ b/drivers/dma/fsl-qdma.c
>> @@ -304,7 +304,7 @@ static void fsl_qdma_free_chan_resources(struct
>> dma_chan *chan)
>>
>> vchan_dma_desc_free_list(&fsl_chan->vchan, &head);
>>
>> - if (!fsl_queue->comp_pool && !fsl_queue->comp_pool)
>> + if (!fsl_queue->comp_pool && !fsl_queue->desc_pool)
>> return;
>>
> Hi Chen,
>
> Thanks very much for your patch, It is really need to check comp_pool and desc_pool here.
> Reviewed-by: Peng Ma <[email protected]>
> Tested-by: Peng Ma <[email protected]>
>
> BR,
> Peng
>> list_for_each_entry_safe(comp_temp, _comp_temp,
>> --
>> 2.7.4
>

2020-01-21 08:26:07

by Vinod Koul

[permalink] [raw]
Subject: Re: [PATCH -next] dmaengine: fsl-qdma: fix duplicated argument to &&

On 20-01-20, 20:58, Chen Zhou wrote:
> There is duplicated argument to && in function fsl_qdma_free_chan_resources,
> which looks like a typo, pointer fsl_queue->desc_pool also needs NULL check,
> fix it.
> Detected with coccinelle.

Applied, thanks

--
~Vinod