net: phy: motorcomm: uninitialized variables in yt8531_link_change_notify()
Subsystems (5)
PATCH v2 1/1 net: phy: motorcomm: uninitialized variables in yt8531_link_change_notify()
These booleans are never set to false, but are just used without being initialized.
---
v2: reverse Christmas tree. Also add "motorcomm" to the subject. It really feels like previous patches to this driver should have had motorcomm in the subject as well. It's a common anti-pattern to only put the subsystem name and not the driver name when adding a new file.
drivers/net/phy/motorcomm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/phy/motorcomm.c +3 -3
@@ -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;
Signature · 1 line
2.39.1
Quoted 22 lines · Dan Carpenter
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 <[email protected]>---
v2: reverse Christmas tree. Also add "motorcomm" to the subject. It really feels like previous patches to this driver should have had motorcomm in the subject as well. It's a common anti-pattern to only put the subsystem name and not the driver name when adding a new file.drivers/net/phy/motorcomm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)drivers/net/phy/motorcomm.c +0
-0@@ -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;
drivers/net/phy/motorcomm.c static int yt8531_config_init(struct phy_device *phydev) · line 1542
Quoted 10 lines
drivers/net/phy/motorcomm.c +3
-3+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;
Add cc.
This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:
Quoted 5 lines · On Wed, 15 Feb 2023 07:21:47 +0300 you wrote:
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 <[email protected]>
Quoted 7 lines
---
v2: reverse Christmas tree. Also add "motorcomm" to the subject. It really feels like previous patches to this driver should have had motorcomm in the subject as well. It's a common anti-pattern to only put the subsystem name and not the driver name when adding a new file.[...]
Here is the summary with links:
- [v2,net-next] net: phy: motorcomm: uninitialized variables in yt8531_link_change_notify()
https://git.kernel.org/netdev/net-next/c/9753613f7399
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html