From patchwork Wed Nov 29 17:57:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 120041 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp3364925qgn; Wed, 29 Nov 2017 10:00:12 -0800 (PST) X-Google-Smtp-Source: AGs4zMarlDLbh17q1KJVaC93KY2iLwjR3z3stT93y/j3enHWV7nm6CiTOfVHADYlZVyo4KZEozXJ X-Received: by 10.107.132.19 with SMTP id g19mr4214664iod.47.1511978412852; Wed, 29 Nov 2017 10:00:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511978412; cv=none; d=google.com; s=arc-20160816; b=wieu7f5mH1ZhOozYG1qggfsGuzMo05EUont+veehP1DXS0c5jZ3LBD2uier4+w5ws+ rSdBRNWH8rQLWAyatU+/fy8S5JCs28SkWTGo+AAOD8zyaH1RDDObYrInZFYhFaYvdqn7 8CaH2KPjNm1FHWIaGaU3uZL3HAtBuVVVmwVlVWSUF0P45EQ6z2EAugp+6daEI3Zdyupa 9Wp8c40os2Cno3p54x9hfzXNZ6wjmqtuaEY3MnlFz3Uj4nS6WGHCULxqbA84Lv0CBTvK waRpR62XhcTgp1kGONWjAGs0KSj+ao5Y8iq8pJ5VH9KCjSbyxG9YjeCBtqQGlHKAE6nW auww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:cc:message-id:date:to:from:dkim-signature :arc-authentication-results; bh=mziWHCo5504/0POCPTYVUKIpxVh13qUPe7M4odeU6pM=; b=cn27CyMQvA1Se1C7IRkIYeKiS753yI4wsPmRO2hsHa484zvuSQq9/7jgsQBMTVPYVb zLyZkr8piVA7zQEuZB4x6G4Ly6IpG8Bm0m+b/BveVPFJqsp6/WwH19Z5WpE+uKMemTku BRHNl4RZHZjm7hevYGw0EsOvqR4AUkseHKW3X+dRkNnaLxU5b77lKQjIZv/ESicPiYKX cztHZYV//i+P8eruojnG51jaH5iqhs8h5/CzgmAQq94Ydr4IrdlCFr9G0v1k6/xSVtKT kAt44Og1FS638K6nlsuKq3BARaeR2g3Yc46+deHI9CbgOTcyA7ADOvEEJ7dOUnIJwhR9 5SCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=E+Ve4mLt; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id g205si1606431ioa.148.2017.11.29.10.00.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Nov 2017 10:00:12 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=E+Ve4mLt; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eK6c6-0007R3-Sn; Wed, 29 Nov 2017 17:57:38 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eK6c5-0007Qx-7y for xen-devel@lists.xen.org; Wed, 29 Nov 2017 17:57:37 +0000 Received: from [85.158.139.211] by server-5.bemta-5.messagelabs.com id 7B/A9-04731-015FE1A5; Wed, 29 Nov 2017 17:57:36 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrKIsWRWlGSWpSXmKPExsXiVRvkrMv/VS7 K4MM6CYslHxezODB6HN39mymAMYo1My8pvyKBNWPC2qNMBY1cFcd7exgbGO+xdzFycQgJTGCU aPs8D8xhEWhnlniy8gYbiCMh8I5FYunCdSxdjJxATp7EhGtv2CDsNImlW46zQthVEj9bVjN3M XIAjVKTWPMmCmJqL5PEuu6pbCBxNgEdiXUzakHKRQSkJa59vswIYjMLxEs8nnodbKSwQITE57 MbweIsAqoSl9d+ZQaxeQWsJRZ8m8kEsUpeYlfbRdYJjPwLGBlWMWoUpxaVpRbpGlnqJRVlpme U5CZm5ugaGpjq5aYWFyemp+YkJhXrJefnbmIEBlA9AwPjDsbLW/wOMUpyMCmJ8n5aKBslxJeU n1KZkVicEV9UmpNafIhRhoNDSYLX4bNclJBgUWp6akVaZg4wlGHSEhw8SiK8ISBp3uKCxNziz HSI1ClGe45VE678YeLYt+cWkHw283UDM8e0q61NzEIsefl5qVLivCdB2gRA2jJK8+CGwmLvEq OslDAvIwMDgxBPQWpRbmYJqvwrRnEORiVh3hkgU3gy80rgdr8COosJ6Kyb+6VBzipJREhJNTB ui0o1rduZtGpj+oT1ufF9salyXvqKM3YZZPwPcq7fmaH5YPuzvkOHslZpfmafekBqxSFrHpWt rq8OnPJX7p7eomf9+ruI+eLPTzT82n7qG5d8TteQPyxj5LrojJTskkM35Ke3Bm/+ubL4cHluw BPJY0sUDScfbxEKdr369Bin04EDBvzcu58rsRRnJBpqMRcVJwIAhyJRwLgCAAA= X-Env-Sender: julien.grall@linaro.org X-Msg-Ref: server-16.tower-206.messagelabs.com!1511978255!93502950!1 X-Originating-IP: [74.125.82.67] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 43618 invoked from network); 29 Nov 2017 17:57:35 -0000 Received: from mail-wm0-f67.google.com (HELO mail-wm0-f67.google.com) (74.125.82.67) by server-16.tower-206.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 29 Nov 2017 17:57:35 -0000 Received: by mail-wm0-f67.google.com with SMTP id i11so7639724wmf.4 for ; Wed, 29 Nov 2017 09:57:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=HYZSw7YlSDYuzY4RenBMqgpKJdNc/u7etcQqs8DkpDs=; b=E+Ve4mLttkXgNj9efkN4EZ914fsmk1nFd3Zejf9EvR2zfuvCkO0m3J5XloxAdd9tCn C2DXULOPC+zqglRGFHXAW6alr451fLebkITlNYVPgKv+suVnJKBnszGDbPPh6xbK5iAo YcMylgZMLTvubvyauO5p26qirsYCrghq8mMbo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=HYZSw7YlSDYuzY4RenBMqgpKJdNc/u7etcQqs8DkpDs=; b=jUUqQ7Nb5Wb6oaNvuQi8Qgb/+TzTf9XT70weWewTM3ci/n1kZpJsem9vHY9UySuL8D tJ7DzY5a0L130VkjT8Re7iYpEfnL37h6oty3KXIFNsunUaJyWQYKnvpmZ84hXLEAa5U3 UaRGPH1LZRH+F/JQN9BZPFvWwgxZh2Kq3smBIUL8focmFkg3I0zENY8WQqYnPfbJbdGu NZ/4teH8YiSiwEyapMkvQj33YCyZY4TgKDOCE4Ya/L+1OUJZa7yKv0o5f9LEQdk7tUcg 2oOJk9hUN13gGfFMZuecPkoHTTF22X2QBsVixhKOVhZ4tusah0B3jiC/07bXx0ig6Mta SYGA== X-Gm-Message-State: AJaThX47bMb7MYOZzrgkW48D1J87oYIxFIrsQJIazhEUYk2u1h5juIsf fvguJREXkW9NqVkEI0YKJRP3D3wqyTc= X-Received: by 10.28.144.148 with SMTP id s142mr3456052wmd.82.1511978254780; Wed, 29 Nov 2017 09:57:34 -0800 (PST) Received: from e108454-lin.cambridge.arm.com ([2001:41d0:1:6c23::1]) by smtp.gmail.com with ESMTPSA id c54sm3430854wra.84.2017.11.29.09.57.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Nov 2017 09:57:34 -0800 (PST) From: Julien Grall To: xen-devel@lists.xen.org Date: Wed, 29 Nov 2017 17:57:32 +0000 Message-Id: <20171129175732.7256-1-julien.grall@linaro.org> X-Mailer: git-send-email 2.11.0 Cc: sstabellini@kernel.org, Julien Grall , andre.przywara@linaro.org Subject: [Xen-devel] [PATCH] xen/arm: bootfdt: Use proper default for #address-cells and #size-cells X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Per the device-tree specific [1], when the property #address-cells and #size-cells are not present, the default value should be resp. 1 and 2. [1] https://www.devicetree.org/downloads/devicetree-specification-v0.1-20160524.pdf Signed-off-by: Julien Grall Acked-by: Stefano Stabellini --- This was discovered debugging DT generated by GRUB on ACPI-only platform. I am not aware of any DT relying on that for now, but it would still be nice to be compliant with the spec and avoid surprise. --- xen/arch/arm/bootfdt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/arch/arm/bootfdt.c b/xen/arch/arm/bootfdt.c index 4a687e725d..8eba42c7b9 100644 --- a/xen/arch/arm/bootfdt.c +++ b/xen/arch/arm/bootfdt.c @@ -109,8 +109,8 @@ int __init device_tree_for_each_node(const void *fdt, continue; } - as = depth > 0 ? address_cells[depth-1] : 0; - ss = depth > 0 ? size_cells[depth-1] : 0; + as = depth > 0 ? address_cells[depth-1] : DT_ROOT_NODE_ADDR_CELLS_DEFAULT; + ss = depth > 0 ? size_cells[depth-1] : DT_ROOT_NODE_SIZE_CELLS_DEFAULT; address_cells[depth] = device_tree_get_u32(fdt, node, "#address-cells", as);