mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-14 17:06:24 -04:00
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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
e260e404ba
commit
e1ab75dd62
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user