Re: [PATCH 07/21] of: port Linux of_get_compatible_child helper

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

 



Hello Sascha,

On 4/14/20 8:46 AM, Sascha Hauer wrote:
> for_each_child_of_node() goes down to list_for_each_entry(). On an empty
> list child will point to the list head after leaving the loop. Return
> child explicitly when it's compatible and NULL when leaving the loop
> which is better readable as well.

argh, it looked fishy to me as well, but I didn't think about comparing
Linux and barebox implementation. I just reviewed the 70 instances
of for_each_child_of_node we have and it seems only one other instance
in the overlay code has made the same assumption as I did:
 - drivers/of/resolver.c: of_resolve_phandles (grep for /if (!overlay_child)/)

I can send a fixup to make it more readable but I'd want to change
for_each_child_of_node to align it with Linux behavior as well.

Cheers
Ahmad

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux