From: Geliang Tang Date: Sat, 3 Oct 2015 03:00:14 +0000 (+0800) Subject: RDMA/amso1100: use offset_in_page macro X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0bc2763f569ff9533a8222bcb884ef0e22569a72;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git RDMA/amso1100: use offset_in_page macro Use offset_in_page macro instead of (addr & ~PAGE_MASK). Signed-off-by: Geliang Tang Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rdma/amso1100/c2_alloc.c b/drivers/staging/rdma/amso1100/c2_alloc.c index 78d247ec6961..039872dfabbc 100644 --- a/drivers/staging/rdma/amso1100/c2_alloc.c +++ b/drivers/staging/rdma/amso1100/c2_alloc.c @@ -131,7 +131,7 @@ void c2_free_mqsp(__be16 *mqsp) *mqsp = (__force __be16) head->head; /* Compute the shared_ptr index */ - idx = ((unsigned long) mqsp & ~PAGE_MASK) >> 1; + idx = (offset_in_page(mqsp)) >> 1; idx -= (unsigned long) &(((struct sp_chunk *) 0)->shared_ptr[0]) >> 1; /* Point this index at the head */ diff --git a/drivers/staging/rdma/amso1100/c2_provider.c b/drivers/staging/rdma/amso1100/c2_provider.c index 25c3f0085563..956d76b111b0 100644 --- a/drivers/staging/rdma/amso1100/c2_provider.c +++ b/drivers/staging/rdma/amso1100/c2_provider.c @@ -359,7 +359,7 @@ static struct ib_mr *c2_reg_phys_mr(struct ib_pd *ib_pd, for (i = 0; i < num_phys_buf; i++) { - if (buffer_list[i].addr & ~PAGE_MASK) { + if (offset_in_page(buffer_list[i].addr)) { pr_debug("Unaligned Memory Buffer: 0x%x\n", (unsigned int) buffer_list[i].addr); return ERR_PTR(-EINVAL);