From patchwork Fri Sep 13 12:49:10 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 20028 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f198.google.com (mail-qc0-f198.google.com [209.85.216.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BCDFE266EA for ; Fri, 13 Sep 2013 12:49:44 +0000 (UTC) Received: by mail-qc0-f198.google.com with SMTP id l13sf1169428qcy.5 for ; Fri, 13 Sep 2013 05:49:44 -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=fkr0IVx4XQ3CMaP8D1jY0nw++k/CVCSdmSWBGUFIN4g=; b=Cy3TgFXTugTU0lbVqyUY/i0qy0ddgOjxNioVRgwfcp7FbP48laSmcFGX1oeHeajgdJ W6XLIqEOCw0S/MVUGIpLj1OqJSViDbmQbUS2frCVfz+aUeTP1GcxO1kueWXhLN/bx8Ao zGXdxgwyPS30uNc1MXRo+2fbHo3X0eh3DAa7ugPK/yDzRYgfTFtdCXcy1got8+TUldPW KDemsnmMQRWylZftmLwXeRd2OFwR1c1M5Rz68SimAVYk10cGxNQSYLkhEv8eY8Abv1fQ I+VrXzkV6ongXK8CvDCPGG+FD9hFxwclWPVWduVKI/cb8UHuTWMjcpM92wnuYzSlb7cL zNXA== X-Gm-Message-State: ALoCoQmxrCtaEnaa5rUVIWnVd39Jc9nKS4NxtVzTQH6oIphJUKr0ccvKnNF+DsvxP4RnD9kapUIx X-Received: by 10.236.90.67 with SMTP id d43mr4980342yhf.36.1379076583948; Fri, 13 Sep 2013 05:49:43 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.81.210 with SMTP id c18ls1274983qey.37.gmail; Fri, 13 Sep 2013 05:49:43 -0700 (PDT) X-Received: by 10.220.105.199 with SMTP id u7mr11602759vco.1.1379076583735; Fri, 13 Sep 2013 05:49:43 -0700 (PDT) Received: from mail-vb0-f51.google.com (mail-vb0-f51.google.com [209.85.212.51]) by mx.google.com with ESMTPS id dt10si3059260vdb.125.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 05:49:43 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.51 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.51; Received: by mail-vb0-f51.google.com with SMTP id x16so850483vbf.24 for ; Fri, 13 Sep 2013 05:49:43 -0700 (PDT) X-Received: by 10.52.24.4 with SMTP id q4mr574752vdf.34.1379076583474; Fri, 13 Sep 2013 05:49:43 -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 u4csp78763vcz; Fri, 13 Sep 2013 05:49:42 -0700 (PDT) X-Received: by 10.14.219.198 with SMTP id m46mr17766592eep.41.1379076581807; Fri, 13 Sep 2013 05:49:41 -0700 (PDT) Received: from mail-ee0-f53.google.com (mail-ee0-f53.google.com [74.125.83.53]) by mx.google.com with ESMTPS id t9si3776616eeo.335.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 05:49:41 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.83.53 is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=74.125.83.53; Received: by mail-ee0-f53.google.com with SMTP id b15so556393eek.40 for ; Fri, 13 Sep 2013 05:49:41 -0700 (PDT) X-Received: by 10.15.83.2 with SMTP id b2mr18262030eez.28.1379076581220; Fri, 13 Sep 2013 05:49:41 -0700 (PDT) Received: from belegaer.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id p5sm14678420eeg.5.1969.12.31.16.00.00 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 05:49:40 -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 v4 03/27] xen/dts: Don't add a fake property "name" in the device tree Date: Fri, 13 Sep 2013 13:49:10 +0100 Message-Id: <1379076574-28316-4-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1379076574-28316-1-git-send-email-julien.grall@linaro.org> References: <1379076574-28316-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.212.51 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 )