From: Dan Carpenter Date: Wed, 15 Feb 2023 04:21:47 +0000 (+0300) Subject: net: phy: motorcomm: uninitialized variables in yt8531_link_change_notify() X-Git-Tag: accepted/tizen/unified/riscv/20230725.071352~126 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=352941f8d53e32c579b9b7292efc94cadb8c4a94;p=platform%2Fkernel%2Flinux-starfive.git net: phy: motorcomm: uninitialized variables in yt8531_link_change_notify() These booleans are never set to false, but are just used without being initialized. Fixes: 4ac94f728a58 ("net: phy: Add driver for Motorcomm yt8531 gigabit ethernet phy") Signed-off-by: Dan Carpenter Reviewed-by: Frank Sae Link: https://lore.kernel.org/r/Y+xd2yJet2ImHLoQ@kili Signed-off-by: Jakub Kicinski Signed-off-by: Jaehoon Chung Change-Id: I1b34e53290b0e99aa7d2e5c7269625cdc6a779cb --- diff --git a/drivers/net/phy/motorcomm.c b/drivers/net/phy/motorcomm.c index ee7c37dfdca0..2fa5a90e073b 100644 --- a/drivers/net/phy/motorcomm.c +++ b/drivers/net/phy/motorcomm.c @@ -1533,10 +1533,10 @@ static int yt8531_config_init(struct phy_device *phydev) static void yt8531_link_change_notify(struct phy_device *phydev) { struct device_node *node = phydev->mdio.dev.of_node; + bool tx_clk_1000_inverted = false; + bool tx_clk_100_inverted = false; + bool tx_clk_10_inverted = false; bool tx_clk_adj_enabled = false; - bool tx_clk_1000_inverted; - bool tx_clk_100_inverted; - bool tx_clk_10_inverted; u16 val = 0; int ret;