public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: saeed <saeed@marvell.com>
Cc: "Sosnowski, Maciej" <maciej.sosnowski@intel.com>,
	Nicolas Pitre <nico@cam.org>,
	Lennert Buytenhek <buytenh@wantstofly.org>,
	Russell King <linux@arm.linux.org.uk>,
	lkml <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH/RFC] DMA engine driver for Marvell XOR engine
Date: Mon, 07 Jul 2008 15:49:59 -0700	[thread overview]
Message-ID: <1215470999.24400.3.camel@dwillia2-linux.ch.intel.com> (raw)
In-Reply-To: <alpine.DEB.0.99.0807060021160.9671@ubuntu-saeed.il.marvell.com>


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


      reply	other threads:[~2008-07-07 22:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-23 16:46 [PATCH/RFC] DMA engine driver for Marvell XOR engine Nicolas Pitre
2008-06-23 21:55 ` Dan Williams
2008-06-26 22:33 ` Dan Williams
2008-06-27  0:21   ` Nicolas Pitre
2008-06-30 14:09 ` Sosnowski, Maciej
2008-07-01 16:07   ` saeed
2008-07-01 23:41     ` Dan Williams
2008-07-06 11:23       ` saeed
2008-07-07 22:49         ` Dan Williams [this message]

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=1215470999.24400.3.camel@dwillia2-linux.ch.intel.com \
    --to=dan.j.williams@intel.com \
    --cc=buytenh@wantstofly.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=maciej.sosnowski@intel.com \
    --cc=nico@cam.org \
    --cc=saeed@marvell.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