diff mbox

[RESEND/PATCH,4/4] dma: mv_xor: Rename __mv_xor_slot_cleanup() to mv_xor_slot_cleanup()

Message ID 1397485267-9412-5-git-send-email-ezequiel.garcia@free-electrons.com (mailing list archive)
State Not Applicable
Delegated to: Dan Williams
Headers show

Commit Message

Ezequiel Garcia April 14, 2014, 2:21 p.m. UTC
Now that mv_xor_slot_cleanup() has no remaining callers, we remove it
and rename __mv_xor_slot_cleanup() to mv_xor_slot_cleanup().

We take this opportunity to add a comment that makes it clear that the
channel spinlock should be held before calling mv_xor_slot_cleanup().

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
---
 drivers/dma/mv_xor.c | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)

Comments

Ben Dooks April 14, 2014, 2:32 p.m. UTC | #1
On 14/04/14 15:21, Ezequiel Garcia wrote:
> Now that mv_xor_slot_cleanup() has no remaining callers, we remove it
> and rename __mv_xor_slot_cleanup() to mv_xor_slot_cleanup().
>
> We take this opportunity to add a comment that makes it clear that the
> channel spinlock should be held before calling mv_xor_slot_cleanup().
>
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>

In that order, should the patch be from Thomas Petazzoni as well?
Ezequiel Garcia April 14, 2014, 3:15 p.m. UTC | #2
On Apr 14, Ben Dooks wrote:
> On 14/04/14 15:21, Ezequiel Garcia wrote:
> >Now that mv_xor_slot_cleanup() has no remaining callers, we remove it
> >and rename __mv_xor_slot_cleanup() to mv_xor_slot_cleanup().
> >
> >We take this opportunity to add a comment that makes it clear that the
> >channel spinlock should be held before calling mv_xor_slot_cleanup().
> >
> >Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> >Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
> 
> In that order, should the patch be from Thomas Petazzoni as well?
> 

Yes, I guess it makes sense. Should I re-send the patch?
diff mbox

Patch

diff --git a/drivers/dma/mv_xor.c b/drivers/dma/mv_xor.c
index 3be4e70..a57f3a8 100644
--- a/drivers/dma/mv_xor.c
+++ b/drivers/dma/mv_xor.c
@@ -310,7 +310,8 @@  mv_xor_clean_slot(struct mv_xor_desc_slot *desc,
 	return 0;
 }
 
-static void __mv_xor_slot_cleanup(struct mv_xor_chan *mv_chan)
+/* This function must be called with the mv_xor_chan spinlock held */
+static void mv_xor_slot_cleanup(struct mv_xor_chan *mv_chan)
 {
 	struct mv_xor_desc_slot *iter, *_iter;
 	dma_cookie_t cookie = 0;
@@ -366,20 +367,12 @@  static void __mv_xor_slot_cleanup(struct mv_xor_chan *mv_chan)
 		mv_chan->dmachan.completed_cookie = cookie;
 }
 
-static void
-mv_xor_slot_cleanup(struct mv_xor_chan *mv_chan)
-{
-	spin_lock_bh(&mv_chan->lock);
-	__mv_xor_slot_cleanup(mv_chan);
-	spin_unlock_bh(&mv_chan->lock);
-}
-
 static void mv_xor_tasklet(unsigned long data)
 {
 	struct mv_xor_chan *chan = (struct mv_xor_chan *) data;
 
 	spin_lock_bh(&chan->lock);
-	__mv_xor_slot_cleanup(chan);
+	mv_xor_slot_cleanup(chan);
 	spin_unlock_bh(&chan->lock);
 }
 
@@ -661,7 +654,7 @@  static void mv_xor_free_chan_resources(struct dma_chan *chan)
 
 	spin_lock_bh(&mv_chan->lock);
 
-	__mv_xor_slot_cleanup(mv_chan);
+	mv_xor_slot_cleanup(mv_chan);
 
 	list_for_each_entry_safe(iter, _iter, &mv_chan->chain,
 					chain_node) {
@@ -708,7 +701,7 @@  static enum dma_status mv_xor_status(struct dma_chan *chan,
 		return ret;
 
 	spin_lock_bh(&mv_chan->lock);
-	__mv_xor_slot_cleanup(mv_chan);
+	mv_xor_slot_cleanup(mv_chan);
 	spin_unlock_bh(&mv_chan->lock);
 
 	return dma_cookie_status(chan, cookie, txstate);