]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
phy: lynx-28g: avoid memsetting lane already allocated with kzalloc()
authorVladimir Oltean <vladimir.oltean@nxp.com>
Tue, 25 Nov 2025 11:48:36 +0000 (13:48 +0200)
committerVinod Koul <vkoul@kernel.org>
Tue, 23 Dec 2025 17:41:06 +0000 (23:11 +0530)
"priv" is allocated by lynx_28g_probe() using devm_kzalloc(), and the
lane is memory inside that structure (&priv->lane[id]). We don't have to
zero-initialize it, it is already filled with zeroes.

Suggested-by: Vinod Koul <vkoul@kernel.org>
Link: https://lore.kernel.org/linux-phy/aRYMM3ZuyBYH8zEC@vaman/
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Link: https://patch.msgid.link/20251125114847.804961-5-vladimir.oltean@nxp.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/phy/freescale/phy-fsl-lynx-28g.c

index 61a992ff274f2956fed28b42b176b2e5a1e7200d..f6e6ea1262bce37acb74dfda58e8298446e9627c 100644 (file)
@@ -592,8 +592,6 @@ static int lynx_28g_probe_lane(struct lynx_28g_priv *priv, int id,
        struct lynx_28g_lane *lane = &priv->lane[id];
        struct phy *phy;
 
-       memset(lane, 0, sizeof(*lane));
-
        phy = devm_phy_create(priv->dev, dn, &lynx_28g_ops);
        if (IS_ERR(phy))
                return PTR_ERR(phy);