Re: [PATCH 04/18] software_node: Enforce parent before child ordering of nodes array for software_node_register_nodes()

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

 



On Mon, Nov 30, 2020 at 07:35:30PM +0200, Andy Shevchenko wrote:
> On Mon, Nov 30, 2020 at 01:31:15PM +0000, Daniel Scally wrote:

...

> >  	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)) {

For being it shorter you may use temporary variable:

		software_node *parent;

		parent = nodes[i].parent;
		if (parent && !software_node_to_swnode(parent)) {

-- 
With Best Regards,
Andy Shevchenko





[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