lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 3 Sep 2019 14:24:13 +0300
From:   Sakari Ailus <sakari.ailus@...ux.intel.com>
To:     Heikki Krogerus <heikki.krogerus@...ux.intel.com>
Cc:     Petr Mladek <pmladek@...e.com>, linux-kernel@...r.kernel.org,
        rafael@...nel.org,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        linux-acpi@...r.kernel.org, devicetree@...r.kernel.org,
        Rob Herring <robh@...nel.org>
Subject: Re: [PATCH v5 05/11] device property: Add fwnode_get_name for
 returning the name of a node

Moi,

Thanks for the comments.

On Tue, Sep 03, 2019 at 01:10:13PM +0300, Heikki Krogerus wrote:
> Hi Sakari,
> 
> On Mon, Sep 02, 2019 at 04:57:26PM +0300, Sakari Ailus wrote:
> > diff --git a/drivers/base/swnode.c b/drivers/base/swnode.c
> > index 951e7efd47c23..a4a0f5b80bad3 100644
> > --- a/drivers/base/swnode.c
> > +++ b/drivers/base/swnode.c
> > @@ -515,6 +515,25 @@ static int software_node_read_string_array(const struct fwnode_handle *fwnode,
> >  						propname, val, nval);
> >  }
> >  
> > +static const char *
> > +software_node_get_name(const struct fwnode_handle *fwnode)
> > +{
> > +	const struct software_node *softnode = to_software_node(fwnode);
> > +	const struct swnode *swnode = software_node_to_swnode(softnode);
> 
> Why not just:
> 
>         struct swnode *swnode = to_swnode(fwnode);

Fixed.

> 
> > +	struct fwnode_handle *parent;
> > +
> > +	if (!swnode)
> > +		return "(null)";
> > +
> > +	parent = fwnode_get_parent(&swnode->fwnode);
> > +	if (!parent)
> > +		return "";
> 
> Please note that there is no root software node object (the kset is
> the root), so you will get "" with most nodes. I'm assuming that is
> not the intention, or is it?

Good point.

In practice this will happen rarely outside the tests, but indeed the root
node would usually not be a software node. I'll drop the above three lines
checking for the parent node, and change nodes created in the test
accordingly.

-- 
Terveisin,

Sakari Ailus
sakari.ailus@...ux.intel.com

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ