[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: Henry Wang <Henry.Wang@xxxxxxx>, Vikram Garhwal <vikram.garhwal@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Fri, 2 Jun 2023 09:24:12 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=arm.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); 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=b1dho4j3ITrGzunz0Tk5zT7Rk8cy9W8B6MfB411khX0=; b=Mkn6uHcg7d7D/5m95Ua5TXoZ55CScPBHxxbYCAnCrPIA7oh+mdhPoTZZ8TFdp2cHd+jut3GIusPoyX0sRAv6N8PvEAweDJCb220WZtfuKtoa5hPERC44IcQxG0PUGXWy9dUQsoqPYOD7Jhl+wAQrKRWohTXujGtwzGeo/xKnY3mtlqWrzKi8JxpmNdcH9h7iu9Nn55oMyX8ERNHGb7G9v+nl0C7ZQBZLQu8fM6Q9FY1QbAzUM/4IhIaEmkSG0iyvuDwOPdQQrQCvX/T6DVcdUzS1OzmhdVgYcXhPixzHeOTzHZOJHkKv+7pvERFonhOzOrvJmtI2SNrCaTc3/RBrpg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HOcnkr4Jxdh1RRrm7EKbqvxRFNqkvcL3aKMF5NeZJKD1rKK2C//F1X5NwLhfobxAFWGvVkIsIVqPJxBekQprqYXSb6KqjanoqoKRN80SR4gu15IrR+yB3Z1YNKbUHCB9MvD3Sf6oebpT7VAEhWb32Moa3YPDy+f6m/5o3LNmsabjfJqIAYeawUBUj9VcjAR3Gegfc+9ZROS7lw+Gug+wsS/rL2MNNU8icCc50kBSTQKW8wkF1zJiwnxRDkl6oQZ0O4hPlzgJ1fGjGnfdh5Sa1Hu1iEyZN4txT+ZVRX17YybBqNO4jmkC+Zi/0Fb5YCTAv1SW2y+KmvLVGOpl1LYd/Q==
  • Cc: "sstabellini@xxxxxxxxxx" <sstabellini@xxxxxxxxxx>, "jbeulich@xxxxxxxx" <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>
  • Delivery-date: Fri, 02 Jun 2023 07:24:39 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 02/06/2023 03:52, Henry Wang wrote:
> 
> 
> 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)
+1

With the indentation fixed:
Reviewed-by: Michal Orzel <michal.orzel@xxxxxxx>

~Michal




 


Rackspace

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