qemu-trivial
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-trivial] [PATCH] dma-helpers: avoid calling dma_bdrv_unmap() t


From: Paolo Bonzini
Subject: Re: [Qemu-trivial] [PATCH] dma-helpers: avoid calling dma_bdrv_unmap() twice
Date: Fri, 23 May 2014 10:23:25 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0

Il 23/05/2014 05:44, Jules Wang ha scritto:
Calling dma_bdrv_unmap() twice is not necessary and may cause
potential problems if some code changes.

Signed-off-by: Jules Wang <address@hidden>
---
 dma-helpers.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dma-helpers.c b/dma-helpers.c
index 5f421e9..53cbe92 100644
--- a/dma-helpers.c
+++ b/dma-helpers.c
@@ -143,12 +143,12 @@ static void dma_bdrv_cb(void *opaque, int ret)

     dbs->acb = NULL;
     dbs->sector_num += dbs->iov.size / 512;
-    dma_bdrv_unmap(dbs);

     if (dbs->sg_cur_index == dbs->sg->nsg || ret < 0) {
         dma_complete(dbs, ret);
         return;
     }
+    dma_bdrv_unmap(dbs);

     while (dbs->sg_cur_index < dbs->sg->nsg) {
         cur_addr = dbs->sg->sg[dbs->sg_cur_index].base + dbs->sg_cur_byte;


Reviewed-by: Paolo Bonzini <address@hidden>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]