diff mbox series

[net-next] net: phy: Uninitialized variables in yt8531_link_change_notify()

Message ID Y+utT+5q5Te1GvYk@kili (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series [net-next] net: phy: Uninitialized variables in yt8531_link_change_notify() | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers success CCed 10 of 10 maintainers
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 12 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Dan Carpenter Feb. 14, 2023, 3:48 p.m. UTC
These booleans are never set to false, but are just used uninitialized.

Fixes: 4ac94f728a58 ("net: phy: Add driver for Motorcomm yt8531 gigabit ethernet phy")
Signed-off-by: Dan Carpenter <error27@gmail.com>
---
Applies to net-next.

 drivers/net/phy/motorcomm.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Dan Carpenter Feb. 14, 2023, 3:50 p.m. UTC | #1
On Tue, Feb 14, 2023 at 06:48:31PM +0300, Dan Carpenter wrote:
> These booleans are never set to false, but are just used uninitialized.
> 
> Fixes: 4ac94f728a58 ("net: phy: Add driver for Motorcomm yt8531 gigabit ethernet phy")
> Signed-off-by: Dan Carpenter <error27@gmail.com>
> ---
> Applies to net-next.
> 

Sorry for sending this twice.  :/

regards,
dan carpenter
Frank Sae Feb. 15, 2023, 1:51 a.m. UTC | #2
On 2023/2/14 23:48, Dan Carpenter wrote:

> @@ -1534,9 +1534,9 @@ static void yt8531_link_change_notify(struct phy_device *phydev)
>  {
>  	struct device_node *node = phydev->mdio.dev.of_node;
>  	bool tx_clk_adj_enabled = false;
> -	bool tx_clk_1000_inverted;
> -	bool tx_clk_100_inverted;
> -	bool tx_clk_10_inverted;
> +	bool tx_clk_1000_inverted = false;
> +	bool tx_clk_100_inverted = false;
> +	bool tx_clk_10_inverted = false;

Thanks, please keep reverse christmas tree.

>  	u16 val = 0;
>  	int ret;
>
Dan Carpenter Feb. 15, 2023, 4:22 a.m. UTC | #3
On Wed, Feb 15, 2023 at 09:51:56AM +0800, Frank Sae wrote:
> 
> 
> On 2023/2/14 23:48, Dan Carpenter wrote:
> 
> > @@ -1534,9 +1534,9 @@ static void yt8531_link_change_notify(struct phy_device *phydev)
> >  {
> >  	struct device_node *node = phydev->mdio.dev.of_node;
> >  	bool tx_clk_adj_enabled = false;
> > -	bool tx_clk_1000_inverted;
> > -	bool tx_clk_100_inverted;
> > -	bool tx_clk_10_inverted;
> > +	bool tx_clk_1000_inverted = false;
> > +	bool tx_clk_100_inverted = false;
> > +	bool tx_clk_10_inverted = false;
> 
> Thanks, please keep reverse christmas tree.
> 

Right.  Good point.

regards,
dan carpenter
diff mbox series

Patch

diff --git a/drivers/net/phy/motorcomm.c b/drivers/net/phy/motorcomm.c
index ee7c37dfdca0..119a54d6c65d 100644
--- a/drivers/net/phy/motorcomm.c
+++ b/drivers/net/phy/motorcomm.c
@@ -1534,9 +1534,9 @@  static void yt8531_link_change_notify(struct phy_device *phydev)
 {
 	struct device_node *node = phydev->mdio.dev.of_node;
 	bool tx_clk_adj_enabled = false;
-	bool tx_clk_1000_inverted;
-	bool tx_clk_100_inverted;
-	bool tx_clk_10_inverted;
+	bool tx_clk_1000_inverted = false;
+	bool tx_clk_100_inverted = false;
+	bool tx_clk_10_inverted = false;
 	u16 val = 0;
 	int ret;