From: Amitoj Kaur Chawla Date: Sat, 20 Feb 2016 13:38:02 +0000 (+0530) Subject: staging: rdma: hfi1: Use offset_in_page macro X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=72a5f6a8df46fe61eb64be8e76e244e9d15b8a0e;p=openwrt%2Fstaging%2Fblogic.git staging: rdma: hfi1: Use offset_in_page macro Use offset_in_page macro instead of (var & ~PAGE_MASK) The Coccinelle semantic patch used to make this change is as follows: // @@ unsigned long p; @@ - p & ~PAGE_MASK + offset_in_page(p) // Signed-off-by: Amitoj Kaur Chawla Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/rdma/hfi1/user_sdma.c b/drivers/staging/rdma/hfi1/user_sdma.c index 4f5595060501..feb206995653 100644 --- a/drivers/staging/rdma/hfi1/user_sdma.c +++ b/drivers/staging/rdma/hfi1/user_sdma.c @@ -925,8 +925,8 @@ static int user_sdma_send_pkts(struct user_sdma_request *req, unsigned maxpkts) unsigned pageidx, len; base = (unsigned long)iovec->iov.iov_base; - offset = ((base + iovec->offset + iov_offset) & - ~PAGE_MASK); + offset = offset_in_page(base + iovec->offset + + iov_offset); pageidx = (((iovec->offset + iov_offset + base) - (base & PAGE_MASK)) >> PAGE_SHIFT); len = offset + req->info.fragsize > PAGE_SIZE ?