[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [XEN][PATCH v7 08/19] xen/device-tree: Add device_tree_find_node_by_path() to find nodes in device tree


  • To: Vikram Garhwal <vikram.garhwal@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Henry Wang <Henry.Wang@xxxxxxx>
  • Date: Fri, 2 Jun 2023 01:52:47 +0000
  • Accept-language: zh-CN, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=K0NQxd+XEjJNS+8C5C/l9cvvYxaMlDQrPrSDsYlk538=; b=YUT7KQRJACGoAwLn6F6CJIjobiJVBYyrP30Uq1OAn6q6KUQhJE6K363D/Y0Ohyxsvrmzt5bsj/EaQJNyAjGGr6GkV5VXwiLzCU64/+NeIvY3klyaYvcZV5z9Gs3LHA7DtiAyNI9XUIKNZFvpGmeSLsmW8G86R6j/VFMSlyV7Lskp9F6lF5Gc+YncUQUJMSHGiYoJcZ+flfI5TLLFLiE26gYt56D0I0s1MvY15BGrl2JM74CLKab1Fd1D5cqRSr9/QtJ7rVJbliqOYizSNQxJMq7RT5OE/KcxyBEZ/V9m0wI2fWYMnRCx693AUxoFAwWaVeLtXo/1ygevHInxg+R1+g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KQWCNbo5svX3B5l4BppP9kOysnk/MLh1AVqJv36ifj/H724fruW4S/ivW1rRR+Cn9Y1DNVW9Zp4sbnCfa2x18EWT2x+kxs2qlMC/v/SqwmAfTCyrAaiXEczJPZhGRB2CMF+VBMHxquv+pVypoR37NqSm72CPC4v0BgukmTltZeFkt7v8wGWmrZUssj2LvW9HYU4+oLBcwsU3Ze022HNMDWdjcac0e/vf1c+hxPyvSbibw5Tih3ZWDXEkiga43RS287O7kfn/g/O5f/vhUX58/DON8DAbT1ZoIXAM/jFideXrLJGlJxtwFwlFPVzLWD8CadXFfXwrhNo9ToAHqDOzaQ==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: "michal.orzel@xxxxxxx" <michal.orzel@xxxxxxx>, "sstabellini@xxxxxxxxxx" <sstabellini@xxxxxxxxxx>, "jbeulich@xxxxxxxx" <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>
  • Delivery-date: Fri, 02 Jun 2023 01:53:14 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHZlOwR4Ipv6iy3bEahGOYsyZBxb692vxnQ
  • Thread-topic: [XEN][PATCH v7 08/19] xen/device-tree: Add device_tree_find_node_by_path() to find nodes in device tree

Hi Vikram,

> -----Original Message-----
> Subject: [XEN][PATCH v7 08/19] xen/device-tree: Add
> device_tree_find_node_by_path() to find nodes in device tree
> 
> Add device_tree_find_node_by_path() to find a matching node with path for
> a
> dt_device_node.
> 
> Reason behind this function:
>     Each time overlay nodes are added using .dtbo, a new fdt(memcpy of
>     device_tree_flattened) is created and updated with overlay nodes. This
>     updated fdt is further unflattened to a dt_host_new. Next, we need to find
>     the overlay nodes in dt_host_new, find the overlay node's parent in 
> dt_host
>     and add the nodes as child under their parent in the dt_host. Thus we need
>     this function to search for node in different unflattened device trees.
> 
> Also, make dt_find_node_by_path() static inline.
> 
> Signed-off-by: Vikram Garhwal <vikram.garhwal@xxxxxxx>
> 
> ---
> Changes from v6:
>     Rename "dt_node" to "from"
> ---
>  xen/common/device_tree.c      |  6 ++++--
>  xen/include/xen/device_tree.h | 18 ++++++++++++++++--
>  2 files changed, 20 insertions(+), 4 deletions(-)
> 
> diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
> index 16b4b4e946..c5250a1644 100644
> --- a/xen/common/device_tree.c
> +++ b/xen/common/device_tree.c
> @@ -358,11 +358,13 @@ struct dt_device_node
> *dt_find_node_by_type(struct dt_device_node *from,
>      return np;
>  }
> 
> -struct dt_device_node *dt_find_node_by_path(const char *path)
> +struct dt_device_node *
> +                    device_tree_find_node_by_path(struct dt_device_node 
> *from,
> +                                                  const char *path)

NIT: I found that the indentation here is a bit strange to me. I personally 
would
write like:
struct dt_device_node *
device_tree_find_node_by_path(struct dt_device_node *from, char *path)

[...]

> -struct dt_device_node *dt_find_node_by_path(const char *path);
> +struct dt_device_node *
> +                    device_tree_find_node_by_path(struct dt_device_node 
> *from,
> +                                                  const char *path);

Same here.

But anyway, the content of this patch looks good to me and I confirm you've
addressed the comment of mine and Michal's in v6, so:

Reviewed-by: Henry Wang <Henry.Wang@xxxxxxx>

Kind regards,
Henry



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.