]> www.infradead.org Git - users/dwmw2/linux.git/commit
Merge branch 'net-switch-to-scoped-device_for_each_child_node'
authorJakub Kicinski <kuba@kernel.org>
Fri, 4 Oct 2024 16:28:28 +0000 (09:28 -0700)
committerJakub Kicinski <kuba@kernel.org>
Fri, 4 Oct 2024 16:28:28 +0000 (09:28 -0700)
commit7d68b6f664a0a0f3f5afd3e6d9fda2a8bea05890
treee08fa0c5a0d090479d6fbba12135406546e0ddde
parent6443cf1bdf7909f055e2182138ff1f434a741517
parente97dccd3e976331cd2c9fa17fcb716af19bd5c68
Merge branch 'net-switch-to-scoped-device_for_each_child_node'

Javier Carrasco says:

====================
net: switch to scoped device_for_each_child_node()

This series switches from the device_for_each_child_node() macro to its
scoped variant. This makes the code more robust if new early exits are
added to the loops, because there is no need for explicit calls to
fwnode_handle_put(), which also simplifies existing code.

The non-scoped macros to walk over nodes turn error-prone as soon as
the loop contains early exits (break, goto, return), and patches to
fix them show up regularly, sometimes due to new error paths in an
existing loop [1].

Note that the child node is now declared in the macro, and therefore the
explicit declaration is no longer required.

The general functionality should not be affected by this modification.
If functional changes are found, please report them back as errors.

Link: https://lore.kernel.org/20240901160829.709296395@linuxfoundation.org
v1: https://lore.kernel.org/r/20240930-net-device_for_each_child_node_scoped-v1-0-bbdd7f9fd649@gmail.com
====================

Link: https://patch.msgid.link/20240930-net-device_for_each_child_node_scoped-v2-0-35f09333c1d7@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>