Re: [PATCH net-next 1/3] device property: Introduce fwnode_for_each_available_child_node_scoped()

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

 



On Tue, Oct 08, 2024 at 06:10:27PM +0200, Javier Carrasco wrote:
> Introduce the scoped variant of the
> fwnode_for_each_available_child_node() to automatically decrement the
> child's refcount when it goes out of scope, removing the need for
> explicit calls to fwnode_handle_put().

...

> +#define fwnode_for_each_available_child_node_scoped(fwnode, child)	       \
> +	for (struct fwnode_handle *child __free(fwnode_handle) =	       \
> +		fwnode_get_next_available_child_node(fwnode, NULL); child;     \
> +	     child = fwnode_get_next_available_child_node(fwnode, child))

I like the wrapping you have done here.
Can you align the device_for_each_child_node_scoped() to follow your variant?

(probably in an additional patch)

For this one
Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>

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