Messages in this thread Patch in this message | | | Subject | Re: [PATCH/RFC] DMA engine driver for Marvell XOR engine | From | Dan Williams <> | Date | Mon, 07 Jul 2008 15:49:59 -0700 |
| |
On Sun, 2008-07-06 at 04:23 -0700, saeed wrote: > > > The admittedly ugly do { } while () loop in iop-adma.c assumed that > > num_descs_in_pool is always > 1, and guarantees that idx is equal to > > the count of allocated descriptors. Since you changed it to a simple > > while() loop then you should also replace idx with ->slots_allocated > > in the rest of the routine i.e.: > > > > return mv_chan->slots_allocated ? : -ENOMEM; > done. > Here is the updated patch:
checkpatch said: ERROR: code indent should use tabs where possible #636: FILE: drivers/dma/mv_xor.c:602: + ^Iidx = mv_chan->slots_allocated;$
WARNING: line over 80 characters #672: FILE: drivers/dma/mv_xor.c:638: + return (mv_chan->slots_allocated > 0) ? mv_chan->slots_allocated : -ENOMEM;
...so I made the following quick edits before applying:
diff --git a/drivers/dma/mv_xor.c b/drivers/dma/mv_xor.c index 82f5631..f0c123c 100644 --- a/drivers/dma/mv_xor.c +++ b/drivers/dma/mv_xor.c @@ -599,7 +599,7 @@ static int mv_xor_alloc_chan_resources(struct dma_chan *chan) int num_descs_in_pool = plat_data->pool_size/MV_XOR_SLOT_SIZE; /* Allocate descriptor slots */ - idx = mv_chan->slots_allocated; + idx = mv_chan->slots_allocated; while (idx < num_descs_in_pool) { slot = kzalloc(sizeof(*slot), GFP_KERNEL); if (!slot) { @@ -635,7 +635,7 @@ static int mv_xor_alloc_chan_resources(struct dma_chan *chan) "allocated %d descriptor slots last_used: %p\n", mv_chan->slots_allocated, mv_chan->last_used); - return (mv_chan->slots_allocated > 0) ? mv_chan->slots_allocated : -ENOMEM; + return mv_chan->slots_allocated ? : -ENOMEM; } static struct dma_async_tx_descriptor * -- Dan
| |