[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20080701155323.2e2e351e@hskinnemo-gx745.norway.atmel.com>
Date: Tue, 1 Jul 2008 15:53:23 +0200
From: Haavard Skinnemoen <haavard.skinnemoen@...el.com>
To: "Sosnowski, Maciej" <maciej.sosnowski@...el.com>
Cc: "Williams, Dan J" <dan.j.williams@...el.com>,
"lkml" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] dmatest: Simple DMA memcpy test client
Subject: [PATCH] dmatest: Return DMA_NAK if nr_channels >= max_channels
"Sosnowski, Maciej" <maciej.sosnowski@...el.com> wrote:
> In case when nr_channels exceeds max_channels
> ack should be rather set to DMA_NAK than DMA_DUP.
You're right. The below patch should take care of this.
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@...el.com>
---
drivers/dma/dmatest.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/dma/dmatest.c b/drivers/dma/dmatest.c
index 5c9fd10..a08d197 100644
--- a/drivers/dma/dmatest.c
+++ b/drivers/dma/dmatest.c
@@ -398,13 +398,13 @@ dmatest_event(struct dma_client *client, struct dma_chan *chan,
switch (state) {
case DMA_RESOURCE_AVAILABLE:
- if (dmatest_match_channel(chan)
- && dmatest_match_device(chan->device)
- && (!max_channels
- || nr_channels < max_channels))
- ack = dmatest_add_channel(chan);
- else
+ if (!dmatest_match_channel(chan)
+ || !dmatest_match_device(chan->device))
ack = DMA_DUP;
+ else if (max_channels && nr_channels >= max_channels)
+ ack = DMA_NAK;
+ else
+ ack = dmatest_add_channel(chan);
break;
case DMA_RESOURCE_REMOVED:
--
1.5.6
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists