Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e57d0552 authored by Geliang Tang's avatar Geliang Tang Committed by Vinod Koul
Browse files

dma-debug: use offset_in_page() macro



Use offset_in_page() macro instead of open-coding.

Signed-off-by: default avatarGeliang Tang <geliangtang@gmail.com>
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
parent b70e52ca
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -1502,7 +1502,7 @@ void debug_dma_alloc_coherent(struct device *dev, size_t size,
	entry->type      = dma_debug_coherent;
	entry->type      = dma_debug_coherent;
	entry->dev       = dev;
	entry->dev       = dev;
	entry->pfn	 = page_to_pfn(virt_to_page(virt));
	entry->pfn	 = page_to_pfn(virt_to_page(virt));
	entry->offset	 = (size_t) virt & ~PAGE_MASK;
	entry->offset	 = offset_in_page(virt);
	entry->size      = size;
	entry->size      = size;
	entry->dev_addr  = dma_addr;
	entry->dev_addr  = dma_addr;
	entry->direction = DMA_BIDIRECTIONAL;
	entry->direction = DMA_BIDIRECTIONAL;
@@ -1518,7 +1518,7 @@ void debug_dma_free_coherent(struct device *dev, size_t size,
		.type           = dma_debug_coherent,
		.type           = dma_debug_coherent,
		.dev            = dev,
		.dev            = dev,
		.pfn		= page_to_pfn(virt_to_page(virt)),
		.pfn		= page_to_pfn(virt_to_page(virt)),
		.offset		= (size_t) virt & ~PAGE_MASK,
		.offset		= offset_in_page(virt),
		.dev_addr       = addr,
		.dev_addr       = addr,
		.size           = size,
		.size           = size,
		.direction      = DMA_BIDIRECTIONAL,
		.direction      = DMA_BIDIRECTIONAL,