aboutsummaryrefslogtreecommitdiffstats
path: root/xen
diff options
context:
space:
mode:
authorJulien Grall <julien.grall@linaro.org>2013-09-27 17:56:35 +0100
committerIan Campbell <ian.campbell@citrix.com>2013-10-08 15:46:07 +0100
commit14c616eca8630f11b24969e06cacfc945ebf3b12 (patch)
treedbcd3babcf58d3a80b28a0cadce8d9ac04c7c768 /xen
parent7ac2e731e94616fd156f16d86ddcf23beabcb1fc (diff)
downloadxen-14c616eca8630f11b24969e06cacfc945ebf3b12.tar.gz
xen-14c616eca8630f11b24969e06cacfc945ebf3b12.tar.bz2
xen-14c616eca8630f11b24969e06cacfc945ebf3b12.zip
xen/dts: Use ROUNDUP macro instead of the internal ALIGN
Signed-off-by: Julien Grall <julien.grall@linaro.org> Acked-by: Ian Campbell <ian.campbell@citrix.com>
Diffstat (limited to 'xen')
-rw-r--r--xen/common/device_tree.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index 27ee70875c..ea8ed56b9f 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -65,8 +65,6 @@ static LIST_HEAD(aliases_lookup);
printk(fmt, ## __VA_ARGS__); \
} while (0)
-#define ALIGN(x, a) ((x + (a) - 1) & ~((a) - 1));
-
// #define DEBUG_DT
#ifdef DEBUG_DT
@@ -457,7 +455,7 @@ static void __init *unflatten_dt_alloc(unsigned long *mem, unsigned long size,
{
void *res;
- *mem = ALIGN(*mem, align);
+ *mem = ROUNDUP(*mem, align);
res = (void *)*mem;
*mem += size;
@@ -1442,7 +1440,7 @@ static unsigned long __init unflatten_dt_node(const void *fdt,
*p += 4;
pathp = (char *)*p;
l = allocl = strlen(pathp) + 1;
- *p = ALIGN(*p + l, 4);
+ *p = ROUNDUP(*p + l, 4);
/* version 0x10 has a more compact unit name here instead of the full
* path. we accumulate the full path size using "fpsize", we'll rebuild
@@ -1535,7 +1533,7 @@ static unsigned long __init unflatten_dt_node(const void *fdt,
noff = be32_to_cpup((__be32 *)((*p) + 4));
*p += 8;
if ( fdt_version(fdt) < 0x10 )
- *p = ALIGN(*p, sz >= 8 ? 8 : 4);
+ *p = ROUNDUP(*p, sz >= 8 ? 8 : 4);
pname = fdt_string(fdt, noff);
if ( pname == NULL )
@@ -1572,7 +1570,7 @@ static unsigned long __init unflatten_dt_node(const void *fdt,
*prev_pp = pp;
prev_pp = &pp->next;
}
- *p = ALIGN((*p) + sz, 4);
+ *p = ROUNDUP((*p) + sz, 4);
}
/* with version 0x10 we may not have the name property, recreate
* it here from the unit name if absent