From patchwork Tue Sep 10 14:48:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 19905 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f70.google.com (mail-yh0-f70.google.com [209.85.213.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 118EE25EA3 for ; Tue, 10 Sep 2013 14:49:28 +0000 (UTC) Received: by mail-yh0-f70.google.com with SMTP id i72sf9521896yha.9 for ; Tue, 10 Sep 2013 07:49:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; 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=fkr0IVx4XQ3CMaP8D1jY0nw++k/CVCSdmSWBGUFIN4g=; b=YyGg2Rsi/6stCz64Nc0hJjTC8qUlIJn0slH3mV8Ro07Sa6h7D/m7JXrcCNMikKLzDq boNeR2i1lCBWUvytx3P0ufDpVh5GYbvcqm0hicXjAUd0ufROcCSsT39pJ5gL5aotnCdb ZQ/VfxWDm1ljNU2QtyncWG5TFN1v6MpNtVqW7mA2PLyjYhzanKZPvh6/OIBtOfPcgiuk SsMqbf4GtYlA884BKI08kTr9I/i1tgEtbGmxRmrZhcWBkNupT8v+EBxgsCsVY/s28PL3 +9WxFW5ThrfUtECJiXnHUZT3WipsR1qda5gMivJvFpkNCyA2naEEmYvc7S+7uhrxxUQa diDw== X-Received: by 10.236.109.134 with SMTP id s6mr8419321yhg.32.1378824567804; Tue, 10 Sep 2013 07:49:27 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.3.169 with SMTP id d9ls2416842qed.61.gmail; Tue, 10 Sep 2013 07:49:27 -0700 (PDT) X-Received: by 10.220.10.194 with SMTP id q2mr23110707vcq.2.1378824567550; Tue, 10 Sep 2013 07:49:27 -0700 (PDT) Received: from mail-ve0-f179.google.com (mail-ve0-f179.google.com [209.85.128.179]) by mx.google.com with ESMTPS id wp10si4526006vdb.32.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Sep 2013 07:49:27 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.179 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.179; Received: by mail-ve0-f179.google.com with SMTP id c14so4728903vea.10 for ; Tue, 10 Sep 2013 07:49:27 -0700 (PDT) X-Gm-Message-State: ALoCoQm7JUr3ONnRCa6M3Lirn5BskEAw1PUP4ygf0/21tws27pkNFUfKQiDtwnLhzfhH9R1OLAvD X-Received: by 10.52.23.113 with SMTP id l17mr7457412vdf.23.1378824567462; Tue, 10 Sep 2013 07:49:27 -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 u4csp4647vcz; Tue, 10 Sep 2013 07:49:26 -0700 (PDT) X-Received: by 10.15.67.131 with SMTP id u3mr39264210eex.34.1378824564856; Tue, 10 Sep 2013 07:49:24 -0700 (PDT) Received: from mail-ee0-f50.google.com (mail-ee0-f50.google.com [74.125.83.50]) by mx.google.com with ESMTPS id 41si15309713eee.167.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Sep 2013 07:49:24 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.83.50 is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=74.125.83.50; Received: by mail-ee0-f50.google.com with SMTP id d51so3902588eek.23 for ; Tue, 10 Sep 2013 07:49:24 -0700 (PDT) X-Received: by 10.14.172.133 with SMTP id t5mr39119331eel.35.1378824564134; Tue, 10 Sep 2013 07:49:24 -0700 (PDT) Received: from belegaer.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id i1sm31911644eeg.0.1969.12.31.16.00.00 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Sep 2013 07:49:23 -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 v3 03/27] xen/dts: Don't add a fake property "name" in the device tree Date: Tue, 10 Sep 2013 15:48:51 +0100 Message-Id: <1378824555-16564-4-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1378824555-16564-1-git-send-email-julien.grall@linaro.org> References: <1378824555-16564-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.179 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 --- Changes in v3: - Reduce the divergence with Linux code --- xen/common/device_tree.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c index 2c2dc52..61134fe 100644 --- a/xen/common/device_tree.c +++ b/xen/common/device_tree.c @@ -1563,8 +1563,17 @@ static unsigned long __init unflatten_dt_node(const void *fdt, pp->name = "name"; pp->length = sz; pp->value = pp + 1; + /* + * The device tree creation code assume that the property + * "name" is not a fake. + * To avoid a big divergence with Linux code, only remove + * property link. In this case we will lose a bit of memory + */ +#if 0 *prev_pp = pp; prev_pp = &pp->next; +#endif + np->name = pp->value; memcpy(pp->value, ps, sz - 1); ((char *)pp->value)[sz - 1] = 0; dt_dprintk("fixed up name for %s -> %s\n", pathp, @@ -1574,7 +1583,7 @@ static unsigned long __init unflatten_dt_node(const void *fdt, 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 )