Hi, On Tue, Jun 09, 2026 at 02:13:35PM +0800, Kaitao Cheng wrote: > From: Kaitao Cheng <[email protected]> > > A later change will make list_for_each_entry() cache the next element > before entering the loop body. for_each_fw_node() intentionally appends > newly discovered child nodes to the temporary walk list while the list is > being traversed. > > Keep the loop open-coded so the next node is looked up only after > children have been appended. This preserves the current breadth-first > traversal semantics and prepares the code for the list iterator update. > > Signed-off-by: Kaitao Cheng <[email protected]> > --- > drivers/firewire/core-topology.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-)
Thanks for the patch. Last September I've realized the issue but not solved yet[1]. A pointer array would be another candidate to store the found nodes, since IEEE 1394 bus a restriction about the maximum number of nodes up to 256. But It is too large if put in kernel stack, while it is slightly difficult to keep it in heap dynamically since the function is called under holding spinning lock. Anyway, there is no objection to your change. Let me apply it to for-next branch so that your further work goes well with no blocks locating in this subsystem. [1] https://social.kernel.org/notice/AyDqvLkpwUvI5eyokK Thanks Takashi Sakamoto
