From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1CA6BC77B7C for ; Thu, 4 May 2023 05:57:12 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.529560.824054 (Exim 4.92) (envelope-from ) id 1puRxM-0005T6-Cw; Thu, 04 May 2023 05:56:44 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 529560.824054; Thu, 04 May 2023 05:56:44 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1puRxM-0005Sz-A7; Thu, 04 May 2023 05:56:44 +0000 Received: by outflank-mailman (input) for mailman id 529560; Thu, 04 May 2023 05:56:43 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1puRxL-0005Sq-CF for xen-devel@lists.xenproject.org; Thu, 04 May 2023 05:56:43 +0000 Received: from mail-vk1-xa33.google.com (mail-vk1-xa33.google.com [2607:f8b0:4864:20::a33]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 7046a8fe-ea40-11ed-8611-37d641c3527e; Thu, 04 May 2023 07:56:40 +0200 (CEST) Received: by mail-vk1-xa33.google.com with SMTP id 71dfb90a1353d-44f985f250aso28151e0c.3 for ; Wed, 03 May 2023 22:56:40 -0700 (PDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 7046a8fe-ea40-11ed-8611-37d641c3527e DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683179799; x=1685771799; h=cc:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=VK/HOsLMJbrMWPV7/oXJICeUdndI85E2By62v77+Wp4=; b=CVPuBUJ70jfuo+olUztYtGZHcgaT7XXOHxwsGCPcDKaXAZEina6PHhvYqVCD1+W6og m0Zo2g+9+K+W+90sghiFTQIkB7lNgChgexYKP8GaBlcct8FnvHAFOHewZtSL6JumaUDz V0Ls3s9JQNX3MYryDyAwfQipDXj5rtfvBzTiYvYU2W6H7/u2S3JHdz0hOwX8XcgsMOds N2SXNIA2Ow+kn2RLHelpzjOqXeNtd7KVFJ4FPo19hpFOkgCzUFTjNcI5p8HfYcQXqOWW n9xqXg7IVTmV0eY47YG2MojzgBTkG3QHi+E6a1iIZb2LnDUZK0w4BKAc7mOudrkjle/I z9JQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683179799; x=1685771799; h=cc:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=VK/HOsLMJbrMWPV7/oXJICeUdndI85E2By62v77+Wp4=; b=Qrb3VNpHF+mjqUYiIeY04FG5RZCUoRr16HQO3l8KM11Sj3nvI/KoetuGl+p1lLdeJP T01y6BFqPUVE3d9gxww5i+Kaffaw8ECwn94k4aHcdfHc1uNnRFyWXtaX2R90vQrKtkTT H+Zdb4dVIW6mfLWgGptWMBF9q4YH1lX2UHiXb53U5QQv6UibnX4tZxUeEkiI/CGTBGlF RfIrHvLuaYDHghPk3qc3ExTd8Bf5PLV8ueLVBrVh7r+zdpAeAhsZzJiks4nXe9I2LPib CXy/qd4p5YXmjH8a8SIZLEbNZmip7cDDcYdNVpE6wS2qfsLNpQJJrkdZaHqNubIOCPw8 sMaA== X-Gm-Message-State: AC+VfDxhafHjn8tDSBmnisdZIeIzElkdra3P3WiImhhDXZMxhITfEVJy rsED+AVkoHAvyLQypuebIKZnf1cXybZS4Qwwl5WQeU0J X-Google-Smtp-Source: ACHHUZ7JaNJYTFJLwDI1ONQaLdQiWw35e54cEKfjeOHNm4IQg2S/uOx5yO3WSEwWNwWYCd0wsuZsW6T2rTceCOO7B+M= X-Received: by 2002:a05:6102:40f:b0:430:76df:b03b with SMTP id d15-20020a056102040f00b0043076dfb03bmr2821153vsq.30.1683179799302; Wed, 03 May 2023 22:56:39 -0700 (PDT) MIME-Version: 1.0 References: <20230502233650.20121-1-vikram.garhwal@amd.com> <20230502233650.20121-9-vikram.garhwal@amd.com> In-Reply-To: From: Terry Yang Date: Thu, 4 May 2023 13:56:27 +0800 Message-ID: Subject: unsubscribe Cc: "xen-devel@lists.xenproject.org" Content-Type: multipart/alternative; boundary="00000000000007d79705fad7d633" --00000000000007d79705fad7d633 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Henry Wang =E4=BA=8E2023=E5=B9=B45=E6=9C=884=E6=97=A5 = =E5=91=A8=E5=9B=9B12:23=E5=86=99=E9=81=93=EF=BC=9A > Hi Vikram, > > > -----Original Message----- > > Subject: [XEN][PATCH v6 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 f= or > > 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 > > --- > > xen/common/device_tree.c | 5 +++-- > > xen/include/xen/device_tree.h | 17 +++++++++++++++-- > > 2 files changed, 18 insertions(+), 4 deletions(-) > > > > [...] > > > /** > > - * dt_find_node_by_path - Find a node matching a full DT path > > + * device_tree_find_node_by_path - Generic function to find a node > > matching the > > + * full DT path for any given unflatten device tree > > + * @dt_node: The device tree to search > > I noticed that you missed Michal's comment here about renaming the > "dt_node" here to "dt" to match below function prototype... > > > * @path: The full path to match > > * > > * Returns a node pointer. > > */ > > -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 *dt, > > ...here. I personally agree with Michal so I think please fix the comment > to keep consistency. > > The rest of the patch looks good to me, so as long as you fixed this, you > can have my: > > Reviewed-by: Henry Wang > > Kind regards, > Henry > > > --00000000000007d79705fad7d633 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


Henry Wang <Henry.= Wang@arm.com>=E4=BA=8E2023=E5=B9=B45=E6=9C=884=E6=97=A5 =E5=91=A8=E5= =9B=9B12:23=E5=86=99=E9=81=93=EF=BC=9A
Hi Vikram,

> -----Original Message-----
> Subject: [XEN][PATCH v6 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:
>=C2=A0 =C2=A0 =C2=A0Each time overlay nodes are added using .dtbo, a ne= w fdt(memcpy of
>=C2=A0 =C2=A0 =C2=A0device_tree_flattened) is created and updated with = overlay nodes. This
>=C2=A0 =C2=A0 =C2=A0updated fdt is further unflattened to a dt_host_new= . Next, we need to find
>=C2=A0 =C2=A0 =C2=A0the overlay nodes in dt_host_new, find the overlay = node's parent in dt_host
>=C2=A0 =C2=A0 =C2=A0and add the nodes as child under their parent in th= e dt_host. Thus we need
>=C2=A0 =C2=A0 =C2=A0this function to search for node in different unfla= ttened device trees.
>
> Also, make dt_find_node_by_path() static inline.
>
> Signed-off-by: Vikram Garhwal <vikram.garhwal@amd.com>
> ---
>=C2=A0 xen/common/device_tree.c=C2=A0 =C2=A0 =C2=A0 |=C2=A0 5 +++--
>=C2=A0 xen/include/xen/device_tree.h | 17 +++++++++++++++--
>=C2=A0 2 files changed, 18 insertions(+), 4 deletions(-)
>

[...]

>=C2=A0 /**
> - * dt_find_node_by_path - Find a node matching a full DT path
> + * device_tree_find_node_by_path - Generic function to find a node > matching the
> + * full DT path for any given unflatten device tree
> + * @dt_node: The device tree to search

I noticed that you missed Michal's comment here about renaming the
"dt_node" here to "dt" to match below function prototyp= e...

>=C2=A0 =C2=A0* @path: The full path to match
>=C2=A0 =C2=A0*
>=C2=A0 =C2=A0* Returns a node pointer.
>=C2=A0 =C2=A0*/
> -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 *dt,

...here. I personally agree with Michal so I think please fix the comment to keep consistency.

The rest of the patch looks good to me, so as long as you fixed this, you can have my:

Reviewed-by: Henry Wang <Henry.Wang@arm.com>

Kind regards,
Henry


--00000000000007d79705fad7d633--