diff options
author | Alexander Kuleshov <kuleshovmail@gmail.com> | 2015-11-05 21:46:40 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-11-05 22:34:48 -0500 |
commit | 5d57b0146aa942b939bbd77e09130270dc9b97d2 (patch) | |
tree | 8d86055329211d6f2e11e70ee3571ac0d5543208 /mm/early_ioremap.c | |
parent | e7bbdd071314b52507e6c615e2cec90d46f82c57 (diff) |
mm/early_ioremap: use offset_in_page macro
linux/mm.h provides offset_in_page() macro. Let's use already predefined
macro instead of (addr & ~PAGE_MASK).
Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/early_ioremap.c')
-rw-r--r-- | mm/early_ioremap.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mm/early_ioremap.c b/mm/early_ioremap.c index 17ae14b5aefa..6d5717bd7197 100644 --- a/mm/early_ioremap.c +++ b/mm/early_ioremap.c | |||
@@ -126,7 +126,7 @@ __early_ioremap(resource_size_t phys_addr, unsigned long size, pgprot_t prot) | |||
126 | /* | 126 | /* |
127 | * Mappings have to be page-aligned | 127 | * Mappings have to be page-aligned |
128 | */ | 128 | */ |
129 | offset = phys_addr & ~PAGE_MASK; | 129 | offset = offset_in_page(phys_addr); |
130 | phys_addr &= PAGE_MASK; | 130 | phys_addr &= PAGE_MASK; |
131 | size = PAGE_ALIGN(last_addr + 1) - phys_addr; | 131 | size = PAGE_ALIGN(last_addr + 1) - phys_addr; |
132 | 132 | ||
@@ -189,7 +189,7 @@ void __init early_iounmap(void __iomem *addr, unsigned long size) | |||
189 | if (WARN_ON(virt_addr < fix_to_virt(FIX_BTMAP_BEGIN))) | 189 | if (WARN_ON(virt_addr < fix_to_virt(FIX_BTMAP_BEGIN))) |
190 | return; | 190 | return; |
191 | 191 | ||
192 | offset = virt_addr & ~PAGE_MASK; | 192 | offset = offset_in_page(virt_addr); |
193 | nrpages = PAGE_ALIGN(offset + size) >> PAGE_SHIFT; | 193 | nrpages = PAGE_ALIGN(offset + size) >> PAGE_SHIFT; |
194 | 194 | ||
195 | idx = FIX_BTMAP_BEGIN - NR_FIX_BTMAPS*slot; | 195 | idx = FIX_BTMAP_BEGIN - NR_FIX_BTMAPS*slot; |
@@ -234,7 +234,7 @@ void __init copy_from_early_mem(void *dest, phys_addr_t src, unsigned long size) | |||
234 | char *p; | 234 | char *p; |
235 | 235 | ||
236 | while (size) { | 236 | while (size) { |
237 | slop = src & ~PAGE_MASK; | 237 | slop = offset_in_page(src); |
238 | clen = size; | 238 | clen = size; |
239 | if (clen > MAX_MAP_CHUNK - slop) | 239 | if (clen > MAX_MAP_CHUNK - slop) |
240 | clen = MAX_MAP_CHUNK - slop; | 240 | clen = MAX_MAP_CHUNK - slop; |