]> git.ipfire.org Git - thirdparty/openwrt.git/commit
realtek: mdio: improve iterator readability
authorMarkus Stockhausen <markus.stockhausen@gmx.de>
Sat, 10 Jan 2026 07:35:35 +0000 (08:35 +0100)
committerStijn Tintel <stijn@linux-ipv6.be>
Mon, 12 Jan 2026 13:43:03 +0000 (15:43 +0200)
commit4acbbf6f058ddf1704960f1c75cd0bea984ecd7e
tree1971ad9caedf7b434e0068587e86e388525c51a6
parent470e030a5eae77e94192e0dd933d7b1b657f7b2c
realtek: mdio: improve iterator readability

Currently there are several places where the driver uses the
classic "i" as iterator. In these cases where it iterates
phy ports use "addr" instead to make it easier to read. Do
the same for the smi bus. Additionally forthcomming commits
will show nicer diffs.

While we are here fix the initialization sequence of the private
structure. There is no need to set data to zero that has already
been zero-allocated before. Instead initialize smi_bus[] with
a value of "-1" to denote that a phy is not in scope. This is
essential as some functions already have a matching check in
place.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21469
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto.c