]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
realtek: mdio: avoid unneeded array initialization 22131/head
authorMarkus Stockhausen <markus.stockhausen@gmx.de>
Sat, 21 Feb 2026 13:26:02 +0000 (14:26 +0100)
committerHauke Mehrtens <hauke@hauke-m.de>
Sun, 1 Mar 2026 13:41:05 +0000 (14:41 +0100)
rtmdio_probe() uses for_each_phy() to access dn[]. This will point
to initialized entries. No need to clear that array in advance.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/22131
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto.c

index bfcc954d5a85230384dc3f74c9c009c455f436af..dd22aa1d93665a4f2cc142c6557067ec649e662e 100644 (file)
@@ -873,7 +873,7 @@ static int rtmdio_reset(struct mii_bus *bus)
 static int rtmdio_probe(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;
-       struct device_node *dn[RTMDIO_MAX_PHY] = {}, *np;
+       struct device_node *np, *dn[RTMDIO_MAX_PHY];
        struct rtmdio_ctrl *ctrl;
        struct mii_bus *bus;
        int ret, addr;