[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 1/2] rdma: constify ram_chunk_{index, start, end}
From: |
Isaku Yamahata |
Subject: |
[Qemu-devel] [PATCH 1/2] rdma: constify ram_chunk_{index, start, end} |
Date: |
Wed, 4 Sep 2013 11:32:19 +0900 |
Signed-off-by: Isaku Yamahata <address@hidden>
---
migration-rdma.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/migration-rdma.c b/migration-rdma.c
index e71c10a..db5a908 100644
--- a/migration-rdma.c
+++ b/migration-rdma.c
@@ -511,19 +511,21 @@ static int qemu_rdma_exchange_send(RDMAContext *rdma,
RDMAControlHeader *head,
int *resp_idx,
int (*callback)(RDMAContext *rdma));
-static inline uint64_t ram_chunk_index(uint8_t *start, uint8_t *host)
+static inline uint64_t ram_chunk_index(const uint8_t *start,
+ const uint8_t *host)
{
return ((uintptr_t) host - (uintptr_t) start) >> RDMA_REG_CHUNK_SHIFT;
}
-static inline uint8_t *ram_chunk_start(RDMALocalBlock *rdma_ram_block,
+static inline uint8_t *ram_chunk_start(const RDMALocalBlock *rdma_ram_block,
uint64_t i)
{
return (uint8_t *) (((uintptr_t) rdma_ram_block->local_host_addr)
+ (i << RDMA_REG_CHUNK_SHIFT));
}
-static inline uint8_t *ram_chunk_end(RDMALocalBlock *rdma_ram_block, uint64_t
i)
+static inline uint8_t *ram_chunk_end(const RDMALocalBlock *rdma_ram_block,
+ uint64_t i)
{
uint8_t *result = ram_chunk_start(rdma_ram_block, i) +
(1UL << RDMA_REG_CHUNK_SHIFT);
--
1.7.10.4
- [Qemu-devel] [PATCH 1/2] rdma: constify ram_chunk_{index, start, end},
Isaku Yamahata <=
- Re: [Qemu-devel] [PATCH 1/2] rdma: constify ram_chunk_{index, start, end}, Juan Quintela, 2013/09/18
- Re: [Qemu-devel] [PATCH 1/2] rdma: constify ram_chunk_{index, start, end}, Michael R. Hines, 2013/09/18