Skip to content

Commit

Permalink
dma-mapping: use offset_in_page macro
Browse files Browse the repository at this point in the history
Use offset_in_page macro instead of (addr & ~PAGE_MASK).

Signed-off-by: Geliang Tang <[email protected]>
Acked-by: Will Deacon <[email protected]>
Cc: Christian Borntraeger <[email protected]>
Cc: Joerg Roedel <[email protected]>
Cc: Sebastian Ott <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
geliangtang authored and torvalds committed Jan 21, 2016
1 parent 20d666e commit 8e99469
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/linux/dma-mapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,10 @@ static inline dma_addr_t dma_map_single_attrs(struct device *dev, void *ptr,
kmemcheck_mark_initialized(ptr, size);
BUG_ON(!valid_dma_direction(dir));
addr = ops->map_page(dev, virt_to_page(ptr),
(unsigned long)ptr & ~PAGE_MASK, size,
offset_in_page(ptr), size,
dir, attrs);
debug_dma_map_page(dev, virt_to_page(ptr),
(unsigned long)ptr & ~PAGE_MASK, size,
offset_in_page(ptr), size,
dir, addr, true);
return addr;
}
Expand Down

0 comments on commit 8e99469

Please sign in to comment.