aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
Diffstat (limited to 'mm')
-rw-r--r--mm/cma.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/mm/cma.c b/mm/cma.c
index ea506eb18cd6..bd0e1412475e 100644
--- a/mm/cma.c
+++ b/mm/cma.c
@@ -183,7 +183,8 @@ int __init cma_init_reserved_mem(phys_addr_t base, phys_addr_t size,
183 return -EINVAL; 183 return -EINVAL;
184 184
185 /* ensure minimal alignment required by mm core */ 185 /* ensure minimal alignment required by mm core */
186 alignment = PAGE_SIZE << max(MAX_ORDER - 1, pageblock_order); 186 alignment = PAGE_SIZE <<
187 max_t(unsigned long, MAX_ORDER - 1, pageblock_order);
187 188
188 /* alignment should be aligned with order_per_bit */ 189 /* alignment should be aligned with order_per_bit */
189 if (!IS_ALIGNED(alignment >> PAGE_SHIFT, 1 << order_per_bit)) 190 if (!IS_ALIGNED(alignment >> PAGE_SHIFT, 1 << order_per_bit))
@@ -266,8 +267,8 @@ int __init cma_declare_contiguous(phys_addr_t base,
266 * migratetype page by page allocator's buddy algorithm. In the case, 267 * migratetype page by page allocator's buddy algorithm. In the case,
267 * you couldn't get a contiguous memory, which is not what we want. 268 * you couldn't get a contiguous memory, which is not what we want.
268 */ 269 */
269 alignment = max(alignment, 270 alignment = max(alignment, (phys_addr_t)PAGE_SIZE <<
270 (phys_addr_t)PAGE_SIZE << max(MAX_ORDER - 1, pageblock_order)); 271 max_t(unsigned long, MAX_ORDER - 1, pageblock_order));
271 base = ALIGN(base, alignment); 272 base = ALIGN(base, alignment);
272 size = ALIGN(size, alignment); 273 size = ALIGN(size, alignment);
273 limit &= ~(alignment - 1); 274 limit &= ~(alignment - 1);