Re: [PATCH net] net: phy: dp83869: fix status reporting for 1000base-x autonegotiation

From: kernel test robot
Date: Tue Oct 29 2024 - 13:58:48 EST


Hi Romain,

kernel test robot noticed the following build warnings:

[auto build test WARNING on 94c11e852955b2eef5c4f0b36cfeae7dcf11a759]

url: https://github.com/intel-lab-lkp/linux/commits/Romain-Gantois/net-phy-dp83869-fix-status-reporting-for-1000base-x-autonegotiation/20241029-173146
base: 94c11e852955b2eef5c4f0b36cfeae7dcf11a759
patch link: https://lore.kernel.org/r/20241029-dp83869-1000base-x-v1-1-fcafe360bd98%40bootlin.com
patch subject: [PATCH net] net: phy: dp83869: fix status reporting for 1000base-x autonegotiation
config: arm-randconfig-004-20241029 (https://download.01.org/0day-ci/archive/20241030/202410300125.K125vk3f-lkp@xxxxxxxxx/config)
compiler: clang version 16.0.6 (https://github.com/llvm/llvm-project 7cbf1a2591520c2491aa35339f227775f4d3adf6)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241030/202410300125.K125vk3f-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202410300125.K125vk3f-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

>> drivers/net/phy/dp83869.c:197:3: warning: variable 'adv' is uninitialized when used here [-Wuninitialized]
adv |= DP83869_BP_FULL_DUPLEX;
^~~
drivers/net/phy/dp83869.c:174:9: note: initialize the variable 'adv' to silence this warning
u32 adv;
^
= 0
1 warning generated.


vim +/adv +197 drivers/net/phy/dp83869.c

168
169 static int dp83869_config_aneg(struct phy_device *phydev)
170 {
171 struct dp83869_private *dp83869 = phydev->priv;
172 unsigned long *advertising;
173 int err, changed = false;
174 u32 adv;
175
176 if (dp83869->mode != DP83869_RGMII_1000_BASE)
177 return genphy_config_aneg(phydev);
178
179 /* Forcing speed or duplex isn't supported in 1000base-x mode */
180 if (phydev->autoneg != AUTONEG_ENABLE)
181 return 0;
182
183 /* In fiber modes, register locations 0xc0... get mapped to offset 0.
184 * Unfortunately, the fiber-specific autonegotiation advertisement
185 * register at address 0xc04 does not have the same bit layout as the
186 * corresponding standard MII_ADVERTISE register. Thus, functions such
187 * as genphy_config_advert() will write the advertisement register
188 * incorrectly.
189 */
190 advertising = phydev->advertising;
191
192 /* Only allow advertising what this PHY supports */
193 linkmode_and(advertising, advertising,
194 phydev->supported);
195
196 if (linkmode_test_bit(ETHTOOL_LINK_MODE_1000baseX_Full_BIT, advertising))
> 197 adv |= DP83869_BP_FULL_DUPLEX;
198 if (linkmode_test_bit(ETHTOOL_LINK_MODE_Pause_BIT, advertising))
199 adv |= DP83869_BP_PAUSE;
200 if (linkmode_test_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT, advertising))
201 adv |= DP83869_BP_ASYMMETRIC_PAUSE;
202
203 err = phy_modify_changed(phydev, DP83869_FX_ANADV,
204 DP83869_BP_FULL_DUPLEX | DP83869_BP_PAUSE |
205 DP83869_BP_ASYMMETRIC_PAUSE,
206 adv);
207
208 if (err < 0)
209 return err;
210 else if (err)
211 changed = true;
212
213 return genphy_check_and_restart_aneg(phydev, changed);
214 }
215

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki