rdma: constify ram_chunk_{index, start, end}
Signed-off-by: Isaku Yamahata <yamahata@private.email.ne.jp> Signed-off-by: Juan Quintela <quintela@redhat.com>
This commit is contained in:
parent
5a91337cdf
commit
dd286ed700
@ -511,19 +511,21 @@ static int qemu_rdma_exchange_send(RDMAContext *rdma, RDMAControlHeader *head,
|
|||||||
int *resp_idx,
|
int *resp_idx,
|
||||||
int (*callback)(RDMAContext *rdma));
|
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;
|
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)
|
uint64_t i)
|
||||||
{
|
{
|
||||||
return (uint8_t *) (((uintptr_t) rdma_ram_block->local_host_addr)
|
return (uint8_t *) (((uintptr_t) rdma_ram_block->local_host_addr)
|
||||||
+ (i << RDMA_REG_CHUNK_SHIFT));
|
+ (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) +
|
uint8_t *result = ram_chunk_start(rdma_ram_block, i) +
|
||||||
(1UL << RDMA_REG_CHUNK_SHIFT);
|
(1UL << RDMA_REG_CHUNK_SHIFT);
|
||||||
|
Loading…
Reference in New Issue
Block a user