Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1628711

[PATCH 2/3] dmaengine: mv_xor: use offset_in_page() macro

From Geliang Tang <geliangtang@gmail.com>
Newsgroups linux.kernel
Subject [PATCH 2/3] dmaengine: mv_xor: use offset_in_page() macro
Date 2017-04-22 03:20 +0200
Message-ID <tyRSp-4HI-3@gated-at.bofh.it> (permalink)
References <tyRSp-4HI-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Use offset_in_page() macro instead of open-coding.

Signed-off-by: Geliang Tang <geliangtang@gmail.com>
---
 drivers/dma/mv_xor.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/dma/mv_xor.c b/drivers/dma/mv_xor.c
index ea53b87..25bc5b1 100644
--- a/drivers/dma/mv_xor.c
+++ b/drivers/dma/mv_xor.c
@@ -960,7 +960,7 @@ static int mv_chan_memcpy_self_test(struct mv_xor_chan *mv_chan)
 	}
 
 	src_dma = dma_map_page(dma_chan->device->dev, virt_to_page(src),
-			       (size_t)src & ~PAGE_MASK, PAGE_SIZE,
+			       offset_in_page(src), PAGE_SIZE,
 			       DMA_TO_DEVICE);
 	unmap->addr[0] = src_dma;
 
@@ -972,7 +972,7 @@ static int mv_chan_memcpy_self_test(struct mv_xor_chan *mv_chan)
 	unmap->to_cnt = 1;
 
 	dest_dma = dma_map_page(dma_chan->device->dev, virt_to_page(dest),
-				(size_t)dest & ~PAGE_MASK, PAGE_SIZE,
+				offset_in_page(dest), PAGE_SIZE,
 				DMA_FROM_DEVICE);
 	unmap->addr[1] = dest_dma;
 
-- 
2.9.3

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 1/3] dmaengine: dmatest: use offset_in_page() macro Geliang Tang <geliangtang@gmail.com> - 2017-04-22 03:20 +0200
  [PATCH 2/3] dmaengine: mv_xor: use offset_in_page() macro Geliang Tang <geliangtang@gmail.com> - 2017-04-22 03:20 +0200
  [PATCH 3/3] dma-debug: use offset_in_page() macro Geliang Tang <geliangtang@gmail.com> - 2017-04-22 03:20 +0200
  Re: [PATCH 1/3] dmaengine: dmatest: use offset_in_page() macro Vinod Koul <vinod.koul@intel.com> - 2017-04-24 15:10 +0200

csiph-web