summaryrefslogtreecommitdiff
path: root/drivers/of
diff options
context:
space:
mode:
authorJoel Stanley <joel@jms.id.au>2016-11-21 02:38:38 +0300
committerJoel Stanley <joel@jms.id.au>2016-11-21 02:38:47 +0300
commitc55cf1296a0429d91b940a49a59977617a4e4cb3 (patch)
tree11d7ae008a0ad5bfe4110966b6df7c44cff723fd /drivers/of
parent5509e6ee766f6b910c3b81c02bae291fc1d9a806 (diff)
parent86429bd405de5741df4127096deae0b1d90b68f1 (diff)
downloadlinux-c55cf1296a0429d91b940a49a59977617a4e4cb3.tar.xz
Merge tag 'v4.4.33' into dev-4.4openbmc-4.4-20161121-1dev-4.4
This is the 4.4.33 stable release Signed-off-by: Joel Stanley <joel@jms.id.au>
Diffstat (limited to 'drivers/of')
-rw-r--r--drivers/of/of_reserved_mem.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/of/of_reserved_mem.c b/drivers/of/of_reserved_mem.c
index ed01c0172e4a..07dd81586c52 100644
--- a/drivers/of/of_reserved_mem.c
+++ b/drivers/of/of_reserved_mem.c
@@ -127,8 +127,12 @@ static int __init __reserved_mem_alloc_size(unsigned long node,
}
/* Need adjust the alignment to satisfy the CMA requirement */
- if (IS_ENABLED(CONFIG_CMA) && of_flat_dt_is_compatible(node, "shared-dma-pool"))
- align = max(align, (phys_addr_t)PAGE_SIZE << max(MAX_ORDER - 1, pageblock_order));
+ if (IS_ENABLED(CONFIG_CMA) && of_flat_dt_is_compatible(node, "shared-dma-pool")) {
+ unsigned long order =
+ max_t(unsigned long, MAX_ORDER - 1, pageblock_order);
+
+ align = max(align, (phys_addr_t)PAGE_SIZE << order);
+ }
prop = of_get_flat_dt_prop(node, "alloc-ranges", &len);
if (prop) {