summaryrefslogtreecommitdiffstats
path: root/drivers/staging/rdma
diff options
context:
space:
mode:
authorGeliang Tang2015-10-03 04:43:11 +0200
committerGreg Kroah-Hartman2015-10-04 14:11:19 +0200
commite1ab75dd6212992cdc0803315f29fdefc45735f1 (patch)
tree48e02c4a55912d74b1691648c6b81c7fe03bddb1 /drivers/staging/rdma
parentIB/hfi1: use offset_in_page macro (diff)
downloadkernel-qcow2-linux-e1ab75dd6212992cdc0803315f29fdefc45735f1.tar.gz
kernel-qcow2-linux-e1ab75dd6212992cdc0803315f29fdefc45735f1.tar.xz
kernel-qcow2-linux-e1ab75dd6212992cdc0803315f29fdefc45735f1.zip
IB/ipath: use offset_in_page macro
Use offset_in_page macro instead of (addr & ~PAGE_MASK). Signed-off-by: Geliang Tang <geliangtang@163.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/rdma')
-rw-r--r--drivers/staging/rdma/ipath/ipath_user_sdma.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/rdma/ipath/ipath_user_sdma.c b/drivers/staging/rdma/ipath/ipath_user_sdma.c
index cc04b7ba3488..e82b3ee2dbe0 100644
--- a/drivers/staging/rdma/ipath/ipath_user_sdma.c
+++ b/drivers/staging/rdma/ipath/ipath_user_sdma.c
@@ -239,7 +239,7 @@ static int ipath_user_sdma_num_pages(const struct iovec *iov)
/* truncate length to page boundary */
static int ipath_user_sdma_page_length(unsigned long addr, unsigned long len)
{
- const unsigned long offset = addr & ~PAGE_MASK;
+ const unsigned long offset = offset_in_page(addr);
return ((offset + len) > PAGE_SIZE) ? (PAGE_SIZE - offset) : len;
}
@@ -298,7 +298,7 @@ static int ipath_user_sdma_pin_pages(const struct ipath_devdata *dd,
dma_addr_t dma_addr =
dma_map_page(&dd->pcidev->dev,
pages[j], 0, flen, DMA_TO_DEVICE);
- unsigned long fofs = addr & ~PAGE_MASK;
+ unsigned long fofs = offset_in_page(addr);
if (dma_mapping_error(&dd->pcidev->dev, dma_addr)) {
ret = -ENOMEM;