From 46ab899a1dd2c704e18b5542aa2297d6e342e803 Mon Sep 17 00:00:00 2001 Message-Id: <46ab899a1dd2c704e18b5542aa2297d6e342e803.1387382496.git.minovotn@redhat.com> In-Reply-To: References: From: Nigel Croxon Date: Thu, 14 Nov 2013 22:53:13 +0100 Subject: [PATCH 37/46] rdma: constify ram_chunk_{index, start, end} RH-Author: Nigel Croxon Message-id: <1384469598-13137-38-git-send-email-ncroxon@redhat.com> Patchwork-id: 55721 O-Subject: [RHEL7.0 PATCH 37/42] rdma: constify ram_chunk_{index, start, end} Bugzilla: 1011720 RH-Acked-by: Orit Wasserman RH-Acked-by: Amit Shah RH-Acked-by: Paolo Bonzini Bugzilla: 1011720 https://bugzilla.redhat.com/show_bug.cgi?id=1011720 >From commit ID: commit dd286ed700c6ca2768ac3452bc5b79af1709296a Author: Isaku Yamahata Date: Wed Sep 4 11:32:19 2013 +0900 rdma: constify ram_chunk_{index, start, end} Signed-off-by: Isaku Yamahata Signed-off-by: Juan Quintela --- migration-rdma.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) Signed-off-by: Michal Novotny --- migration-rdma.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/migration-rdma.c b/migration-rdma.c index be3d984..f79be20 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.11.7