qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Yuval Shaia <yuval.shaia.ml@gmail.com>
To: "Philippe Mathieu-Daudé" <philmd@redhat.com>
Cc: David Hildenbrand <david@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	QEMU Developers <qemu-devel@nongnu.org>,
	Peter Xu <peterx@redhat.com>, Gerd Hoffmann <kraxel@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH 5/8] hw/rdma/rdma_utils: Rename rdma_pci_dma_map 'len' argument
Date: Tue, 18 Jan 2022 12:13:56 +0200	[thread overview]
Message-ID: <CAMPkWoNO2TQbbWh2AgTXpiy0S2H+AOGJUD1e6sGryPCLGWxDbw@mail.gmail.com> (raw)
In-Reply-To: <20211231114901.976937-6-philmd@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 2550 bytes --]

On Fri, 31 Dec 2021 at 13:54, Philippe Mathieu-Daudé <philmd@redhat.com>
wrote:

> Various APIs use 'pval' naming for 'pointer to val'.
> rdma_pci_dma_map() uses 'plen' for 'PCI length', but since
> 'PCI' is already explicit in the function name, simplify
> and rename the argument 'len'. No logical change.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  hw/rdma/rdma_utils.h |  2 +-
>  hw/rdma/rdma_utils.c | 14 +++++++-------
>  2 files changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/hw/rdma/rdma_utils.h b/hw/rdma/rdma_utils.h
> index 9fd0efd940b..0c6414e7e0a 100644
> --- a/hw/rdma/rdma_utils.h
> +++ b/hw/rdma/rdma_utils.h
> @@ -38,7 +38,7 @@ typedef struct RdmaProtectedGSList {
>      GSList *list;
>  } RdmaProtectedGSList;
>
> -void *rdma_pci_dma_map(PCIDevice *dev, dma_addr_t addr, dma_addr_t plen);
> +void *rdma_pci_dma_map(PCIDevice *dev, dma_addr_t addr, dma_addr_t len);
>  void rdma_pci_dma_unmap(PCIDevice *dev, void *buffer, dma_addr_t len);
>  void rdma_protected_gqueue_init(RdmaProtectedGQueue *list);
>  void rdma_protected_gqueue_destroy(RdmaProtectedGQueue *list);
> diff --git a/hw/rdma/rdma_utils.c b/hw/rdma/rdma_utils.c
> index 98df58f6897..61cb8ede0fd 100644
> --- a/hw/rdma/rdma_utils.c
> +++ b/hw/rdma/rdma_utils.c
> @@ -17,29 +17,29 @@
>  #include "trace.h"
>  #include "rdma_utils.h"
>
> -void *rdma_pci_dma_map(PCIDevice *dev, dma_addr_t addr, dma_addr_t plen)
> +void *rdma_pci_dma_map(PCIDevice *dev, dma_addr_t addr, dma_addr_t len)
>  {
>      void *p;
> -    hwaddr len = plen;
> +    hwaddr pci_len = len;
>
>      if (!addr) {
>          rdma_error_report("addr is NULL");
>          return NULL;
>      }
>
> -    p = pci_dma_map(dev, addr, &len, DMA_DIRECTION_TO_DEVICE);
> +    p = pci_dma_map(dev, addr, &pci_len, DMA_DIRECTION_TO_DEVICE);
>      if (!p) {
>          rdma_error_report("pci_dma_map fail, addr=0x%"PRIx64",
> len=%"PRId64,
> -                          addr, len);
> +                          addr, pci_len);
>          return NULL;
>      }
>
> -    if (len != plen) {
> -        rdma_pci_dma_unmap(dev, p, len);
> +    if (pci_len != len) {
> +        rdma_pci_dma_unmap(dev, p, pci_len);
>          return NULL;
>      }
>
> -    trace_rdma_pci_dma_map(addr, p, len);
> +    trace_rdma_pci_dma_map(addr, p, pci_len);
>
>      return p;
>  }
>

Reviewed-by: Yuval Shaia <yuval.shaia.ml@gmail.com>
Tested-by: Yuval Shaia <yuval.shaia.ml@gmail.com>


> --
> 2.33.1
>
>
>

[-- Attachment #2: Type: text/html, Size: 3578 bytes --]

  reply	other threads:[~2022-01-18 10:18 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-31 11:48 [PATCH 0/8] hw/dma: Introduce dma_size_t type definition Philippe Mathieu-Daudé
2021-12-31 11:48 ` [PATCH 1/8] hw/nvram: Restrict stub to sysemu and tools Philippe Mathieu-Daudé
2021-12-31 11:48 ` [PATCH 2/8] hw/pci: Restrict pci-bus stub to sysemu Philippe Mathieu-Daudé
2021-12-31 11:48 ` [PATCH 3/8] hw/pci: Document pci_dma_map() Philippe Mathieu-Daudé
2022-01-04  7:25   ` Peter Xu
2022-01-04  8:36     ` Philippe Mathieu-Daudé
2021-12-31 11:48 ` [PATCH 4/8] hw/dma: Remove CONFIG_USER_ONLY check Philippe Mathieu-Daudé
2021-12-31 11:48 ` [PATCH 5/8] hw/rdma/rdma_utils: Rename rdma_pci_dma_map 'len' argument Philippe Mathieu-Daudé
2022-01-18 10:13   ` Yuval Shaia [this message]
2021-12-31 11:48 ` [PATCH 6/8] hw/scsi: Rename SCSIRequest::resid as 'residual' Philippe Mathieu-Daudé
2021-12-31 11:49 ` [PATCH 7/8] hw/dma: Introduce dma_size_t type definition Philippe Mathieu-Daudé
2022-01-03 10:20   ` David Hildenbrand
2022-01-04  8:50     ` Philippe Mathieu-Daudé
2021-12-31 11:49 ` [PATCH 8/8] hw/dma: Let dma_buf_read() / dma_buf_write() propagate MemTxResult Philippe Mathieu-Daudé
2021-12-31 11:51   ` Philippe Mathieu-Daudé

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=CAMPkWoNO2TQbbWh2AgTXpiy0S2H+AOGJUD1e6sGryPCLGWxDbw@mail.gmail.com \
    --to=yuval.shaia.ml@gmail.com \
    --cc=david@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).