net/e1000: clean LTO warnings
authorAndrzej Ostruszka <aostruszka@marvell.com>
Thu, 7 Nov 2019 15:03:15 +0000 (16:03 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Fri, 8 Nov 2019 14:23:41 +0000 (15:23 +0100)
During LTO build compiler reports some 'false positive' warnings about
variables being possibly used uninitialized.  This patch silences these
warnings.

Exemplary compiler warning to suppress (with LTO enabled):
error: ‘link’ may be used uninitialized in this function
[-Werror=maybe-uninitialized]
  if (link) {

Signed-off-by: Andrzej Ostruszka <aostruszka@marvell.com>
drivers/net/e1000/base/e1000_82543.c
drivers/net/e1000/base/e1000_ich8lan.c
drivers/net/e1000/base/e1000_phy.c

index 810899e..dfde2a8 100644 (file)
@@ -1027,7 +1027,7 @@ STATIC s32 e1000_setup_copper_link_82543(struct e1000_hw *hw)
 {
        u32 ctrl;
        s32 ret_val;
-       bool link;
+       bool link = true;
 
        DEBUGFUNC("e1000_setup_copper_link_82543");
 
index accc6ea..5241cf6 100644 (file)
@@ -5533,7 +5533,7 @@ void e1000_igp3_phy_powerdown_workaround_ich8lan(struct e1000_hw *hw)
 void e1000_gig_downshift_workaround_ich8lan(struct e1000_hw *hw)
 {
        s32 ret_val;
-       u16 reg_data;
+       u16 reg_data = 0;
 
        DEBUGFUNC("e1000_gig_downshift_workaround_ich8lan");
 
index 7d08f83..956c067 100644 (file)
@@ -1664,7 +1664,7 @@ s32 e1000_copper_link_autoneg(struct e1000_hw *hw)
 s32 e1000_setup_copper_link_generic(struct e1000_hw *hw)
 {
        s32 ret_val;
-       bool link;
+       bool link = true;
 
        DEBUGFUNC("e1000_setup_copper_link_generic");