All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Tokarev <mjt@tls.msk.ru>
To: Jules Wang <junqing.wang@cs2c.com.cn>, qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org, pbonzini@redhat.com
Subject: Re: [Qemu-trivial] [PATCH] dma-helpers: avoid calling dma_bdrv_unmap() twice
Date: Sat, 24 May 2014 00:32:01 +0400	[thread overview]
Message-ID: <537FB041.1070400@msgid.tls.msk.ru> (raw)
In-Reply-To: <1400816645-16005-1-git-send-email-junqing.wang@cs2c.com.cn>

23.05.2014 07:44, Jules Wang wrote:
> Calling dma_bdrv_unmap() twice is not necessary and may cause
> potential problems if some code changes.
> 
> Signed-off-by: Jules Wang <junqing.wang@cs2c.com.cn>
> ---
>  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;

Applied to -trivial!

Maybe not-so-trivial, as I had to look at dma_complete() (who calls
dma_bdrv_unmap() ofcourse) to understand what's going on :)

Thank you!

/mjt


WARNING: multiple messages have this Message-ID (diff)
From: Michael Tokarev <mjt@tls.msk.ru>
To: Jules Wang <junqing.wang@cs2c.com.cn>, qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org, pbonzini@redhat.com
Subject: Re: [Qemu-devel] [Qemu-trivial] [PATCH] dma-helpers: avoid calling dma_bdrv_unmap() twice
Date: Sat, 24 May 2014 00:32:01 +0400	[thread overview]
Message-ID: <537FB041.1070400@msgid.tls.msk.ru> (raw)
In-Reply-To: <1400816645-16005-1-git-send-email-junqing.wang@cs2c.com.cn>

23.05.2014 07:44, Jules Wang wrote:
> Calling dma_bdrv_unmap() twice is not necessary and may cause
> potential problems if some code changes.
> 
> Signed-off-by: Jules Wang <junqing.wang@cs2c.com.cn>
> ---
>  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;

Applied to -trivial!

Maybe not-so-trivial, as I had to look at dma_complete() (who calls
dma_bdrv_unmap() ofcourse) to understand what's going on :)

Thank you!

/mjt

  parent reply	other threads:[~2014-05-23 20:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-23  3:44 [Qemu-trivial] [PATCH] dma-helpers: avoid calling dma_bdrv_unmap() twice Jules Wang
2014-05-23  3:44 ` [Qemu-devel] " Jules Wang
2014-05-23  8:23 ` [Qemu-trivial] " Paolo Bonzini
2014-05-23  8:23   ` [Qemu-devel] " Paolo Bonzini
2014-05-23 20:32 ` Michael Tokarev [this message]
2014-05-23 20:32   ` [Qemu-devel] [Qemu-trivial] " Michael Tokarev

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=537FB041.1070400@msgid.tls.msk.ru \
    --to=mjt@tls.msk.ru \
    --cc=junqing.wang@cs2c.com.cn \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.