From patchwork Wed Aug 28 14:47:22 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 19571 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f200.google.com (mail-qc0-f200.google.com [209.85.216.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3738025E58 for ; Wed, 28 Aug 2013 14:48:16 +0000 (UTC) Received: by mail-qc0-f200.google.com with SMTP id b11sf3100686qcw.7 for ; Wed, 28 Aug 2013 07:48:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-gm-message-state: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=XN4Vta1SZoBAZE/QjKj2oBN7LQImtWByK/b2gyZyMNw=; b=c6LLLMdMW8Y3h1kkBW9UcQrXdxJnMX+bsROUq4DOWDRkODLIrBw/Hf5gcgZD9LXSag d1+sfhB5/rf3GUisYS2sQQ9ISqkNElQbsqDxYrnsvvJAGrHK3mh/hNnzujlwAJAB58hv Bp4v6f0B2Y5pPKGIkOda9fdbuj8v6JA+Kj9kwI7VRXnzuFYjLqFcw7p24sP4EM3n57YF gDop19X8miqxefrTqLO2V76j3q+YH5I+mMbybdnEZ5UiBVueY4yhRg3kw4GbdOfDUsQQ 0mqYKd4167zden0KIRrWX32snQbcD+ILf7H7zUknfRG2msSYF6F8g79yDJOKW/GokrQP rR1Q== X-Received: by 10.236.180.71 with SMTP id i47mr5183285yhm.31.1377701296026; Wed, 28 Aug 2013 07:48:16 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.13.66 with SMTP id f2ls385155qec.81.gmail; Wed, 28 Aug 2013 07:48:15 -0700 (PDT) X-Received: by 10.220.43.19 with SMTP id u19mr25904393vce.3.1377701295923; Wed, 28 Aug 2013 07:48:15 -0700 (PDT) Received: from mail-vc0-f177.google.com (mail-vc0-f177.google.com [209.85.220.177]) by mx.google.com with ESMTPS id wa2si6615456vcb.28.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 28 Aug 2013 07:48:15 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.177 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.177; Received: by mail-vc0-f177.google.com with SMTP id gf12so4037622vcb.8 for ; Wed, 28 Aug 2013 07:48:15 -0700 (PDT) X-Gm-Message-State: ALoCoQlTB3d+ZUkwLlW15PFNahUn7S2tUhdnkoZNTyYnewT0qmb7Du2CzHICVnnpVfRPJy/PVflN X-Received: by 10.221.55.4 with SMTP id vw4mr308871vcb.37.1377701295834; Wed, 28 Aug 2013 07:48:15 -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 u4csp359939vcz; Wed, 28 Aug 2013 07:48:15 -0700 (PDT) X-Received: by 10.194.23.196 with SMTP id o4mr2744656wjf.62.1377701294621; Wed, 28 Aug 2013 07:48:14 -0700 (PDT) Received: from mail-we0-f170.google.com (mail-we0-f170.google.com [74.125.82.170]) by mx.google.com with ESMTPS id j2si9496197wje.159.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 28 Aug 2013 07:48:14 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.170 is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=74.125.82.170; Received: by mail-we0-f170.google.com with SMTP id w62so5384527wes.1 for ; Wed, 28 Aug 2013 07:48:14 -0700 (PDT) X-Received: by 10.195.12.170 with SMTP id er10mr20702246wjd.5.1377701293958; Wed, 28 Aug 2013 07:48:13 -0700 (PDT) Received: from belegaer.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id a8sm5590498wie.6.1969.12.31.16.00.00 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 28 Aug 2013 07:48:13 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Cc: stefano.stabellini@eu.citrix.com, ian.campbell@citrix.com, patches@linaro.org, andre.przywara@linaro.org, Julien Grall Subject: [PATCH V1 08/29] xen/dts: Don't add a fake property "name" in the device tree Date: Wed, 28 Aug 2013 15:47:22 +0100 Message-Id: <1377701263-3319-9-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1377701263-3319-1-git-send-email-julien.grall@linaro.org> References: <1377701263-3319-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.220.177 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: , On new Flat Device Tree version, the property "name" may not exist. The property is never used in Xen code except to set the field "name" of dt_device_node. For convenience, remove the fake property. It will save space during the creation of the dom0 FDT. Signed-off-by: Julien Grall --- xen/common/device_tree.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c index be592d2..07a19ac 100644 --- a/xen/common/device_tree.c +++ b/xen/common/device_tree.c @@ -1543,6 +1543,7 @@ static unsigned long __init unflatten_dt_node(const void *fdt, if ( !has_name ) { char *p1 = pathp, *ps = pathp, *pa = NULL; + char *tmp = NULL; int sz; while ( *p1 ) @@ -1556,25 +1557,21 @@ static unsigned long __init unflatten_dt_node(const void *fdt, if ( pa < ps ) pa = p1; sz = (pa - ps) + 1; - pp = unflatten_dt_alloc(&mem, sizeof(struct dt_property) + sz, - __alignof__(struct dt_property)); + + tmp = unflatten_dt_alloc(&mem, sz, 1); if ( allnextpp ) { - pp->name = "name"; - pp->length = sz; - pp->value = pp + 1; - *prev_pp = pp; - prev_pp = &pp->next; - memcpy(pp->value, ps, sz - 1); - ((char *)pp->value)[sz - 1] = 0; - dt_dprintk("fixed up name for %s -> %s\n", pathp, - (char *)pp->value); + memcpy(tmp, ps, sz - 1); + np->name = tmp; + tmp[sz - 1] = 0; + dt_dprintk("fixed up name for %s -> %s\n", pathp, np->name); } } + if ( allnextpp ) { *prev_pp = NULL; - np->name = dt_get_property(np, "name", NULL); + np->name = (np->name) ? : dt_get_property(np, "name", NULL); np->type = dt_get_property(np, "device_type", NULL); if ( !np->name )