From patchwork Fri Sep 27 16:56:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 20674 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f200.google.com (mail-vc0-f200.google.com [209.85.220.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D98EA25E77 for ; Fri, 27 Sep 2013 16:57:26 +0000 (UTC) Received: by mail-vc0-f200.google.com with SMTP id hf12sf2566160vcb.7 for ; Fri, 27 Sep 2013 09:57:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=aQhkjhJdQSaA1HCQccURroTqkMXBXXvXB9+g4sVs3fg=; b=TbjQTtsf5SLgVdu4tIXz2YNS26k2Sa3PVKWS0EPy2tuiElrhdXmF1snACoQ1pIf0IW u5Fcmx3l8//Tfky7hzWJoO8pZ5bWlu2mgicudCoeMTEZS75MVLk95VYvMGnd94ii5itZ 9ZjQzjosqxNX0J6GIcC4bBQdT6GdCS70HLTzu5RrSUk+Qa4qVkw+HpZoTOgJjmdh4Ojo ooK7r0Hp/QXZj4X/6IfSe6Rk+6uUV7tnsbXZhuONOfCn/AwO02/MiV9rlctEa+RdxAdX a2viBiP1r0P99TGia1nWZBMLoj4cAPpuNRPX5lv4uXHBSAE2XaUVGRJFJLKPdsLXkhwh EvXw== X-Gm-Message-State: ALoCoQlRUy/GqAasRUPOyvjaT/k/rd2uGKsYK8v5o3dgY6jUyCKdJrGJuMkvzWuC6daq5NQGxwbl X-Received: by 10.236.88.129 with SMTP id a1mr1297669yhf.40.1380301046658; Fri, 27 Sep 2013 09:57:26 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.38.70 with SMTP id e6ls1479480qek.77.gmail; Fri, 27 Sep 2013 09:57:26 -0700 (PDT) X-Received: by 10.52.187.138 with SMTP id fs10mr5881604vdc.10.1380301046503; Fri, 27 Sep 2013 09:57:26 -0700 (PDT) Received: from mail-ve0-f182.google.com (mail-ve0-f182.google.com [209.85.128.182]) by mx.google.com with ESMTPS id mq14si2047135vcb.131.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 27 Sep 2013 09:57:26 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.182; Received: by mail-ve0-f182.google.com with SMTP id oy12so2211069veb.41 for ; Fri, 27 Sep 2013 09:56:56 -0700 (PDT) X-Received: by 10.52.108.230 with SMTP id hn6mr6039230vdb.28.1380301016398; Fri, 27 Sep 2013 09:56:56 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp439653vcz; Fri, 27 Sep 2013 09:56:55 -0700 (PDT) X-Received: by 10.180.99.3 with SMTP id em3mr3540102wib.4.1380301015180; Fri, 27 Sep 2013 09:56:55 -0700 (PDT) Received: from mail-we0-f173.google.com (mail-we0-f173.google.com [74.125.82.173]) by mx.google.com with ESMTPS id o6si8634016wib.56.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 27 Sep 2013 09:56:55 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.173 is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=74.125.82.173; Received: by mail-we0-f173.google.com with SMTP id w62so3000445wes.32 for ; Fri, 27 Sep 2013 09:56:54 -0700 (PDT) X-Received: by 10.180.184.107 with SMTP id et11mr3468439wic.60.1380301014385; Fri, 27 Sep 2013 09:56:54 -0700 (PDT) Received: from belegaer.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id q5sm15639406wiz.3.1969.12.31.16.00.00 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 27 Sep 2013 09:56:54 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Cc: stefano.stabellini@eu.citrix.com, ian.campbell@citrix.com, patches@linaro.org, tim@xen.org, Julien Grall Subject: [PATCH v3 3/5] xen/dts: Use ROUNDUP macro instead of the internal ALIGN Date: Fri, 27 Sep 2013 17:56:35 +0100 Message-Id: <1380300997-28099-4-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1380300997-28099-1-git-send-email-julien.grall@linaro.org> References: <1380300997-28099-1-git-send-email-julien.grall@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: julien.grall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , --- 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