Skip to content

Commit

Permalink
RDMA/rxe: Pass a pointer to virt_to_page()
Browse files Browse the repository at this point in the history
Like the other calls in this function virt_to_page() expects
a pointer, not an integer.

However since many architectures implement virt_to_pfn() as
a macro, this function becomes polymorphic and accepts both a
(unsigned long) and a (void *).

Fix this up with an explicit cast.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
  • Loading branch information
linusw authored and intel-lab-lkp committed Mar 24, 2023
1 parent 901d9d6 commit f162d87
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/infiniband/sw/rxe/rxe_mr.c
Expand Up @@ -213,7 +213,7 @@ int rxe_mr_init_fast(int max_pages, struct rxe_mr *mr)
static int rxe_set_page(struct ib_mr *ibmr, u64 iova)
{
struct rxe_mr *mr = to_rmr(ibmr);
struct page *page = virt_to_page(iova & mr->page_mask);
struct page *page = virt_to_page((void *)(iova & mr->page_mask));
bool persistent = !!(mr->access & IB_ACCESS_FLUSH_PERSISTENT);
int err;

Expand Down Expand Up @@ -288,7 +288,7 @@ static void rxe_mr_copy_dma(struct rxe_mr *mr, u64 iova, void *addr,
u8 *va;

while (length) {
page = virt_to_page(iova & mr->page_mask);
page = virt_to_page((void *)(iova & mr->page_mask));
bytes = min_t(unsigned int, length,
PAGE_SIZE - page_offset);
va = kmap_local_page(page);
Expand Down Expand Up @@ -488,7 +488,7 @@ int rxe_mr_do_atomic_op(struct rxe_mr *mr, u64 iova, int opcode,

if (mr->ibmr.type == IB_MR_TYPE_DMA) {
page_offset = iova & (PAGE_SIZE - 1);
page = virt_to_page(iova & PAGE_MASK);
page = virt_to_page((void *)(iova & PAGE_MASK));
} else {
unsigned long index;
int err;
Expand Down Expand Up @@ -545,7 +545,7 @@ int rxe_mr_do_atomic_write(struct rxe_mr *mr, u64 iova, u64 value)

if (mr->ibmr.type == IB_MR_TYPE_DMA) {
page_offset = iova & (PAGE_SIZE - 1);
page = virt_to_page(iova & PAGE_MASK);
page = virt_to_page((void *)(iova & PAGE_MASK));
} else {
unsigned long index;
int err;
Expand Down

0 comments on commit f162d87

Please sign in to comment.