2009-07-06 15:18:30

by Nicolas Ferre

[permalink] [raw]
Subject: [PATCH] dmaengine: dmatest: correct thread_count while using multiple thread per channel

It seems that thread_count is not properly calculated in dmatest.
In fact the thread count number that is returned from dmatest_add_threads() is
not correctly added to the thread_count and thus not properly printed.

Signed-off-by: Nicolas Ferre <[email protected]>
---
drivers/dma/dmatest.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/dma/dmatest.c b/drivers/dma/dmatest.c
index 4262ff9..921c5f2 100644
--- a/drivers/dma/dmatest.c
+++ b/drivers/dma/dmatest.c
@@ -508,11 +508,11 @@ static int dmatest_add_channel(struct dma_chan *chan)

if (dma_has_cap(DMA_MEMCPY, dma_dev->cap_mask)) {
cnt = dmatest_add_threads(dtc, DMA_MEMCPY);
- thread_count += cnt > 0 ?: 0;
+ thread_count += cnt > 0 ? cnt : 0;
}
if (dma_has_cap(DMA_XOR, dma_dev->cap_mask)) {
cnt = dmatest_add_threads(dtc, DMA_XOR);
- thread_count += cnt > 0 ?: 0;
+ thread_count += cnt > 0 ? cnt : 0;
}

pr_info("dmatest: Started %u threads using %s\n",
--
1.5.3.7


2009-07-07 07:12:30

by Haavard Skinnemoen

[permalink] [raw]
Subject: Re: [PATCH] dmaengine: dmatest: correct thread_count while using multiple thread per channel

Nicolas Ferre wrote:
> It seems that thread_count is not properly calculated in dmatest.
> In fact the thread count number that is returned from dmatest_add_threads() is
> not correctly added to the thread_count and thus not properly printed.
>
> Signed-off-by: Nicolas Ferre <[email protected]>

Acked-by: Haavard Skinnemoen <[email protected]>

2009-07-07 14:24:55

by Sosnowski, Maciej

[permalink] [raw]
Subject: RE: [PATCH] dmaengine: dmatest: correct thread_count while using multiple thread per channel

Nicolas Ferre wrote:
> It seems that thread_count is not properly calculated in dmatest.
> In fact the thread count number that is returned from dmatest_add_threads() is
> not correctly added to the thread_count and thus not properly printed.
>
> Signed-off-by: Nicolas Ferre <[email protected]>

Acked-by: Maciej Sosnowski <[email protected]>-