[PATCH net-next v2 00/13] net: Simplified with scoped function
Jinjie Ruan
ruanjinjie at huawei.com
Wed Aug 28 20:26:59 PDT 2024
On 2024/8/28 22:32, Andrew Lunn wrote:
> On Wed, Aug 28, 2024 at 11:23:30AM +0800, Jinjie Ruan wrote:
>> Simplify with scoped for each OF child loop and __free(), as well as
>> dev_err_probe().
>>
>> Changes in v2:
>> - Subject prefix: next -> net-next.
>> - Split __free() from scoped for each OF child loop clean.
>> - Fix use of_node_put() instead of __free() for the 5th patch.
>
> I personally think all these __free() are ugly and magical. Can it
> somehow be made part of of_get_child_by_name()? Add an
> of_get_child_by_name_func_ref() which holds a reference to the node
> for the scope of the function?
Yes, that is a good idea, and the __free() doesn't look as readable as
or_each_*child_of_node_scoped().
>
> for_each_available_child_of_node_scoped() is fine. Once you have fixed
> all the reverse christmas tree, please submit them. But i would like
> to see alternatives to __free(), once which are less ugly.
Thank you!
>
> Andrew
>
> ---
> pw-bot: cr
>
More information about the linux-arm-kernel
mailing list