Commit f110f331 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] trivial: use page_to_phys in dma_map_page()

From: Trivial Patch Monkey <trivial@rustcorp.com.au>

From:  Adam Lackorzynski <adam@os.inf.tu-dresden.de>

dma_map_page() can be simplified by using page_to_phys instead of writing the
calculation explicitly.
parent 458a5513
...@@ -51,7 +51,7 @@ dma_map_page(struct device *dev, struct page *page, unsigned long offset, ...@@ -51,7 +51,7 @@ dma_map_page(struct device *dev, struct page *page, unsigned long offset,
size_t size, enum dma_data_direction direction) size_t size, enum dma_data_direction direction)
{ {
BUG_ON(direction == DMA_NONE); BUG_ON(direction == DMA_NONE);
return (dma_addr_t)(page_to_pfn(page)) * PAGE_SIZE + offset; return page_to_phys(page) + offset;
} }
static inline void static inline void
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment