[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201130173530.GO4077@smile.fi.intel.com>
Date: Mon, 30 Nov 2020 19:35:30 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Daniel Scally <djrscally@...il.com>
Cc: linux-kernel@...r.kernel.org, linux-acpi@...r.kernel.org,
linux-gpio@...r.kernel.org, linux-i2c@...r.kernel.org,
linux-media@...r.kernel.org, devel@...ica.org, rjw@...ysocki.net,
lenb@...nel.org, gregkh@...uxfoundation.org,
mika.westerberg@...ux.intel.com, linus.walleij@...aro.org,
bgolaszewski@...libre.com, wsa@...nel.org, yong.zhi@...el.com,
sakari.ailus@...ux.intel.com, bingbu.cao@...el.com,
tian.shu.qiu@...el.com, mchehab@...nel.org, robert.moore@...el.com,
erik.kaneda@...el.com, pmladek@...e.com, rostedt@...dmis.org,
sergey.senozhatsky@...il.com, linux@...musvillemoes.dk,
kieran.bingham+renesas@...asonboard.com, jacopo+renesas@...ndi.org,
laurent.pinchart+renesas@...asonboard.com,
jorhand@...ux.microsoft.com, kitakar@...il.com,
heikki.krogerus@...ux.intel.com
Subject: Re: [PATCH 04/18] software_node: Enforce parent before child
ordering of nodes array for software_node_register_nodes()
On Mon, Nov 30, 2020 at 01:31:15PM +0000, Daniel Scally wrote:
> Registering software_nodes with the .parent member set to point to a
> currently unregistered software_node has the potential for problems,
> so enforce parent -> child ordering in arrays passed to this function.
I agree with Laurent.
...
> for (i = 0; nodes[i].name; i++) {
> + if (nodes[i].parent)
> + if (!software_node_to_swnode(nodes[i].parent)) {
> + ret = -EINVAL;
> + goto err_unregister_nodes;
> + }
> +
Besides that can we pack these conditionals together?
if (nodes[i].parent && !software_node_to_swnode(nodes[i].parent)) {
Do we have sane ordering in software_node_unregister_nodes()?
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists