lkml.org 
[lkml]   [2019]   [Mar]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 3/6] device property: Add a function to obtain a node's prefix
On Tue, Mar 26, 2019 at 02:41:03PM +0200, Sakari Ailus wrote:
> The prefix is used for printing purpose before a node, and it also works
> as a separator between two nodes.
>

One nit below.

> +static const char *
> +acpi_fwnode_get_name_prefix(const struct fwnode_handle *fwnode)
> +{
> + struct fwnode_handle *parent;
> +

> + parent = fwnode_get_parent(fwnode);
> + /* Root node. */

I guess a comment could be easier to read if it goes before parent assignment
line.

> + if (!parent)
> + return "";
> +
> + parent = fwnode_get_next_parent(parent);
> + /* Second node from the root; no prefix here either. */

Ditto.

> + if (!parent)
> + return "";
> +
> + fwnode_handle_put(parent);
> +
> + /* ACPI device or data node. */
> + return ".";
> +}

--
With Best Regards,
Andy Shevchenko


\
 
 \ /
  Last update: 2019-03-26 14:16    [W:0.084 / U:3.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site