From: Julien Grall <julien.grall@linaro.org>
To: xen-devel@lists.xen.org
Cc: patches@linaro.org, tim@xen.org, ian.campbell@citrix.com,
Julien Grall <julien.grall@linaro.org>,
stefano.stabellini@eu.citrix.com
Subject: [PATCH v3 3/5] xen/dts: Use ROUNDUP macro instead of the internal ALIGN
Date: Fri, 27 Sep 2013 17:56:35 +0100 [thread overview]
Message-ID: <1380300997-28099-4-git-send-email-julien.grall@linaro.org> (raw)
In-Reply-To: <1380300997-28099-1-git-send-email-julien.grall@linaro.org>
---
xen/common/device_tree.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index 27ee708..ea8ed56 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
--
1.7.10.4
next prev parent reply other threads:[~2013-09-27 16:56 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-27 16:56 [PATCH v3 0/5] ARM: Support initrd Julien Grall
2013-09-27 16:56 ` [PATCH v3 1/5] xen: Add macros MB and GB Julien Grall
2013-09-27 17:01 ` Andrew Cooper
2013-09-27 17:05 ` Julien Grall
2013-09-27 17:07 ` Andrew Cooper
2013-09-27 16:56 ` [PATCH v3 2/5] xen: Add macro ROUNDUP Julien Grall
2013-09-27 16:56 ` Julien Grall [this message]
2013-09-27 16:56 ` [PATCH v3 4/5] xen/arm: Add support to load initrd in dom0 Julien Grall
2013-09-27 16:56 ` [PATCH v3 5/5] xen/dts: Support Linux initrd DT bindings Julien Grall
2013-10-03 13:14 ` xen: Add MB, GB and ROUNDUP macros to common headers (Was: Re: [PATCH v3 0/5] ARM: Support initrd) Ian Campbell
2013-10-03 19:49 ` Keir Fraser
2013-10-08 15:02 ` [PATCH v3 0/5] ARM: Support initrd Ian Campbell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1380300997-28099-4-git-send-email-julien.grall@linaro.org \
--to=julien.grall@linaro.org \
--cc=ian.campbell@citrix.com \
--cc=patches@linaro.org \
--cc=stefano.stabellini@eu.citrix.com \
--cc=tim@xen.org \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).