Re: [PATCH] net: phy: Add driver for Motorcomm Quad 2.5GbE phy

From: kernel test robot

Date: Wed Aug 05 2026 - 18:29:24 EST


Hi Kyle,

kernel test robot noticed the following build warnings:

[auto build test WARNING on net/main]
[also build test WARNING on linus/master v7.2-rc6 next-20260805]
[cannot apply to net-next/main]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/Kyle-Switch/net-phy-Add-driver-for-Motorcomm-Quad-2-5GbE-phy/20260805-175843
base: net/main
patch link: https://lore.kernel.org/r/20260714111203.3852126-1-kyle.switch%40motor-comm.com
patch subject: [PATCH] net: phy: Add driver for Motorcomm Quad 2.5GbE phy
config: powerpc64-randconfig-002-20260806 (https://download.01.org/0day-ci/archive/20260806/202608060635.338Kkf6r-lkp@xxxxxxxxx/config)
compiler: clang version 22.1.3 (https://github.com/llvm/llvm-project e9846648fd6183ee6d8cbdb4502213fcf902a211)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260806/202608060635.338Kkf6r-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/202608060635.338Kkf6r-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

>> drivers/net/phy/motorcomm.c:3336:7: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
3336 | if (reg_space == YT8824_RSSR_UTP_SPACE) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/phy/motorcomm.c:3353:44: note: uninitialized use occurs here
3353 | return phy_restore_page(phydev, old_page, ret);
| ^~~
drivers/net/phy/motorcomm.c:3336:3: note: remove the 'if' if its condition is always true
3336 | if (reg_space == YT8824_RSSR_UTP_SPACE) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/phy/motorcomm.c:3335:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
3335 | if (old_page >= 0) {
| ^~~~~~~~~~~~~
drivers/net/phy/motorcomm.c:3353:44: note: uninitialized use occurs here
3353 | return phy_restore_page(phydev, old_page, ret);
| ^~~
drivers/net/phy/motorcomm.c:3335:2: note: remove the 'if' if its condition is always true
3335 | if (old_page >= 0) {
| ^~~~~~~~~~~~~~~~~~
>> drivers/net/phy/motorcomm.c:3332:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
3332 | if (old_page < 0)
| ^~~~~~~~~~~~
drivers/net/phy/motorcomm.c:3353:44: note: uninitialized use occurs here
3353 | return phy_restore_page(phydev, old_page, ret);
| ^~~
drivers/net/phy/motorcomm.c:3332:2: note: remove the 'if' if its condition is always false
3332 | if (old_page < 0)
| ^~~~~~~~~~~~~~~~~
3333 | goto err_restore_page;
| ~~~~~~~~~~~~~~~~~~~~~
drivers/net/phy/motorcomm.c:3329:9: note: initialize the variable 'ret' to silence this warning
3329 | int ret;
| ^
| = 0
>> drivers/net/phy/motorcomm.c:3341:8: warning: variable 'port' is uninitialized when used here [-Wuninitialized]
3341 | if (port == 0 || port == 2) {
| ^~~~
drivers/net/phy/motorcomm.c:3328:10: note: initialize the variable 'port' to silence this warning
3328 | int port;
| ^
| = 0
drivers/net/phy/motorcomm.c:4464:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
4464 | if (old_page < 0)
| ^~~~~~~~~~~~
drivers/net/phy/motorcomm.c:4477:44: note: uninitialized use occurs here
4477 | return phy_restore_page(phydev, old_page, ret);
| ^~~
drivers/net/phy/motorcomm.c:4464:2: note: remove the 'if' if its condition is always false
4464 | if (old_page < 0)
| ^~~~~~~~~~~~~~~~~
4465 | goto err_restore_page;
| ~~~~~~~~~~~~~~~~~~~~~
drivers/net/phy/motorcomm.c:4460:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
4460 | if (old_page < 0)
| ^~~~~~~~~~~~
drivers/net/phy/motorcomm.c:4477:44: note: uninitialized use occurs here
4477 | return phy_restore_page(phydev, old_page, ret);
| ^~~
drivers/net/phy/motorcomm.c:4460:2: note: remove the 'if' if its condition is always false
4460 | if (old_page < 0)
| ^~~~~~~~~~~~~~~~~
4461 | goto err_restore_page;
| ~~~~~~~~~~~~~~~~~~~~~
drivers/net/phy/motorcomm.c:4457:9: note: initialize the variable 'ret' to silence this warning
4457 | int ret;
| ^
| = 0
drivers/net/phy/motorcomm.c:4641:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
4641 | if (old_page < 0)
| ^~~~~~~~~~~~
drivers/net/phy/motorcomm.c:4660:44: note: uninitialized use occurs here
4660 | return phy_restore_page(phydev, old_page, ret);
| ^~~
drivers/net/phy/motorcomm.c:4641:2: note: remove the 'if' if its condition is always false
4641 | if (old_page < 0)
| ^~~~~~~~~~~~~~~~~
4642 | goto err_restore_page;
| ~~~~~~~~~~~~~~~~~~~~~
drivers/net/phy/motorcomm.c:4638:9: note: initialize the variable 'ret' to silence this warning
4638 | int ret;
| ^
| = 0
7 warnings generated.


vim +3336 drivers/net/phy/motorcomm.c

3320
3321 /**
3322 * disable YT8824 template test mode.
3323 */
3324 static int yt8824_soft_reset_step4_paged(struct phy_device *phydev,
3325 int reg_space)
3326 {
3327 int old_page;
3328 int port;
3329 int ret;
3330
3331 old_page = phy_select_page(phydev, reg_space);
> 3332 if (old_page < 0)
3333 goto err_restore_page;
3334
3335 if (old_page >= 0) {
> 3336 if (reg_space == YT8824_RSSR_UTP_SPACE) {
3337 /* normal mode */
3338 ret = ytphy_write_mmd(phydev, 0x1, 0x0084, 0x0000);
3339 if (ret < 0)
3340 goto err_restore_page;
> 3341 if (port == 0 || port == 2) {
3342 /* read the calibration val of band after power on,
3343 * * only for recording.
3344 */
3345 ret = ytphy_read_ext(phydev, 0x043e);
3346 if (ret < 0)
3347 goto err_restore_page;
3348 }
3349 }
3350 }
3351
3352 err_restore_page:
3353 return phy_restore_page(phydev, old_page, ret);
3354 }
3355

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