From: David Hildenbrand <david@redhat.com>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>, qemu-devel@nongnu.org
Cc: "Fam Zheng" <fam@euphon.net>, "Hannes Reinecke" <hare@suse.com>,
qemu-block@nongnu.org, "Michael S. Tsirkin" <mst@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@redhat.com>,
"Yuval Shaia" <yuval.shaia.ml@gmail.com>,
"Peter Xu" <peterx@redhat.com>,
"Klaus Jensen" <its@irrelevant.dk>,
"Keith Busch" <kbusch@kernel.org>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"John Snow" <jsnow@redhat.com>
Subject: Re: [PATCH v2 5/9] hw/rdma/rdma_utils: Rename rdma_pci_dma_map 'len' argument
Date: Mon, 10 Jan 2022 09:46:02 +0100 [thread overview]
Message-ID: <2d167e0c-a6dc-3528-2ede-b6a1e12e9de3@redhat.com> (raw)
In-Reply-To: <20220104085431.2122999-6-f4bug@amsat.org>
On 04.01.22 09:54, Philippe Mathieu-Daudé wrote:
> From: Philippe Mathieu-Daudé <philmd@redhat.com>
>
> 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>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> 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: David Hildenbrand <david@redhat.com>
--
Thanks,
David / dhildenb
next prev parent reply other threads:[~2022-01-10 8:52 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-04 8:54 [PATCH v2 0/9] hw/dma: Use dma_addr_t type definition when relevant Philippe Mathieu-Daudé
2022-01-04 8:54 ` [PATCH v2 1/9] hw/nvram: Restrict stub to sysemu and tools Philippe Mathieu-Daudé
2022-01-07 0:17 ` Richard Henderson
2022-01-11 10:43 ` Philippe Mathieu-Daudé
2022-01-04 8:54 ` [PATCH v2 2/9] hw/pci: Restrict pci-bus stub to sysemu Philippe Mathieu-Daudé
2022-01-07 0:18 ` Richard Henderson
2022-01-10 8:43 ` David Hildenbrand
2022-01-04 8:54 ` [PATCH v2 3/9] hw/pci: Document pci_dma_map() Philippe Mathieu-Daudé
2022-01-07 0:20 ` Richard Henderson
2022-01-04 8:54 ` [PATCH v2 4/9] hw/dma: Remove CONFIG_USER_ONLY check Philippe Mathieu-Daudé
2022-01-07 0:20 ` Richard Henderson
2022-01-10 8:45 ` David Hildenbrand
2022-01-04 8:54 ` [PATCH v2 5/9] hw/rdma/rdma_utils: Rename rdma_pci_dma_map 'len' argument Philippe Mathieu-Daudé
2022-01-07 0:21 ` Richard Henderson
2022-01-10 8:46 ` David Hildenbrand [this message]
2022-01-04 8:54 ` [PATCH v2 6/9] hw/scsi: Rename SCSIRequest::resid as 'residual' Philippe Mathieu-Daudé
2022-01-07 0:22 ` Richard Henderson
2022-01-10 8:46 ` David Hildenbrand
2022-01-04 8:54 ` [PATCH v2 7/9] hw/dma: Fix format string issues using dma_addr_t Philippe Mathieu-Daudé
2022-01-07 0:24 ` Richard Henderson
2022-01-10 8:47 ` David Hildenbrand
2022-01-04 8:54 ` [PATCH v2 8/9] hw/dma: Use dma_addr_t type definition when relevant Philippe Mathieu-Daudé
2022-01-04 9:55 ` Peter Xu
2022-01-10 8:49 ` David Hildenbrand
2022-01-10 9:05 ` Philippe Mathieu-Daudé
2022-01-04 8:54 ` [PATCH v2 9/9] hw/dma: Let dma_buf_read() / dma_buf_write() propagate MemTxResult Philippe Mathieu-Daudé
2022-01-10 8:51 ` David Hildenbrand
2022-01-10 9:07 ` Philippe Mathieu-Daudé
2022-01-06 11:08 ` [PATCH v2 0/9] hw/dma: Use dma_addr_t type definition when relevant Michael S. Tsirkin
2022-01-11 18:47 ` 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=2d167e0c-a6dc-3528-2ede-b6a1e12e9de3@redhat.com \
--to=david@redhat.com \
--cc=f4bug@amsat.org \
--cc=fam@euphon.net \
--cc=hare@suse.com \
--cc=its@irrelevant.dk \
--cc=jsnow@redhat.com \
--cc=kbusch@kernel.org \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peterx@redhat.com \
--cc=philmd@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=yuval.shaia.ml@gmail.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;
as well as URLs for NNTP newsgroup(s).