Re: [PATCH v2 3/6] device property: Add a function to obtain a node's prefix

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

 



Hi Andy,

On Tue, Mar 26, 2019 at 03:16:26PM +0200, Andy Shevchenko wrote:
> 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.

Only if the comments are changed accordingly. What we're doing here is
trying to figure out whether this is the root node. I can do that for v3.

> 
> > +	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 ".";
> > +}

-- 
Regards,

Sakari Ailus
sakari.ailus@xxxxxxxxxxxxxxx



[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux