[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [XEN][RFC PATCH v3 05/14] xen/device-tree: Add _dt_find_node_by_path() to find nodes in device tree
- To: Vikram Garhwal <fnu.vikram@xxxxxxxxxx>
- From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
- Date: Mon, 14 Mar 2022 15:35:45 +0000
- Accept-language: en-GB, 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=mkD05uplLEp7mBYLZoJBUEKsIlaEpaz0CRsM2QYgifY=; b=KOWgfvyPnSj4JUpAAX550c01D8Etxxd2bDqgP05/hxgL9OoS+FBfRiIkMZQ6SKwsUOp/xEPzBuRx02/2/P7pboAO3WkQs64Gm96CrbM/QslK4NDNrZNBQzwabeTdwRzBIr3nCQqfQQFHdPElhJAXCw7UxOnlHXB5KZ7WCal/UCvmAlLSN9PUGh16O9FBCmYL+/Hf0pxZOxkXy7qtd+YRP5zYT0RvPOE22nUtA8mncJeqSgmWkQL5iYYKH3dF72cadXTE/nGUmnX/ziaOn68rRi3sVkgaAwA37t9ughGIBVEKFQ/R/fqs+eCZ+RHEEUp9+WMsvuJir/0VgE50WAWdqQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Mjt+0pTtt5hY+qXuaSUD5/aa5r/3UqgrkNj1tMOm3osRtHMcB00Q5qCwytDJ2phzpfLi+nYdJxPqdE9R49O3qis3LHXgqRy9Dhc3K3I0fgu2KwXyuNNDTXTdeHTi2ixAuaq4enSFVDaOllNvNcvoI+1doJiE/BeJB2FnlJ/TwmVcabrb9SPqSomKCIJAjUJi8YQZpzAZGbixfUXeRx25b5tbftyNCsdVWn+lO9nUYCu4cATtPtJEtx1deDAkTNsC7XDU+Q4y2nWMmTJlGE+aSXa9i85EQV5CjmUy0UijWUWCtW4iBM0OToCtSkaBSBUdYCzzYy2/aao55/oj4tkTMg==
- Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "sstabellini@xxxxxxxxxx" <sstabellini@xxxxxxxxxx>, "julien@xxxxxxx" <julien@xxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, "volodymyr_babchuk@xxxxxxxx" <volodymyr_babchuk@xxxxxxxx>
- Delivery-date: Mon, 14 Mar 2022 15:36:12 +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: AQHYMyVuH8IU/vkP80S9r/WX11Sag6y/DAsA
- Thread-topic: [XEN][RFC PATCH v3 05/14] xen/device-tree: Add _dt_find_node_by_path() to find nodes in device tree
Hi Vikram,
> On 8 Mar 2022, at 19:46, Vikram Garhwal <fnu.vikram@xxxxxxxxxx> wrote:
>
> Add _dt_find_by_path() to find a matching node with path for a dt_device_node.
>
> Signed-off-by: Vikram Garhwal <fnu.vikram@xxxxxxxxxx>
> ---
> xen/common/device_tree.c | 10 ++++++++--
> xen/include/xen/device_tree.h | 9 +++++++++
> 2 files changed, 17 insertions(+), 2 deletions(-)
>
> diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
> index f43d66a501..2e334f949e 100644
> --- a/xen/common/device_tree.c
> +++ b/xen/common/device_tree.c
> @@ -358,17 +358,23 @@ 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 *_dt_find_node_by_path(struct dt_device_node *dt,
> + const char *path)
A function with a name starting with an underscore feels to me more an internal
function rather than public,
I suggest to find another name, maybe device_tree_find_node_by_path?
> {
> struct dt_device_node *np;
>
> - dt_for_each_device_node(dt_host, np)
> + dt_for_each_device_node(dt, np)
> if ( np->full_name && (dt_node_cmp(np->full_name, path) == 0) )
> break;
>
> return np;
> }
>
> +struct dt_device_node *dt_find_node_by_path(const char *path)
> +{
> + return _dt_find_node_by_path(dt_host, path);
> +}
This is public but it’s not declared in device_tree.h. Maybe this can become a
static inline defined in the header?
Cheers,
Luca
|