:::::: 
:::::: Manual check reason: "low confidence static check warning: 
drivers/net/phy/micrel.c:1537:9: warning: Uninitialized variable: ret 
[uninitvar]"
:::::: 

CC: [email protected]
BCC: [email protected]
CC: [email protected]
TO: Oleksij Rempel <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   9886142c7a2226439c1e3f7d9b69f9c7094c3ef6
commit: 49011e0c1555dd7a689d0f32fd78c1ecd43e59cd net: phy: micrel: 
ksz886x/ksz8081: add cabletest support
date:   12 months ago
:::::: branch date: 20 hours ago
:::::: commit date: 12 months ago
compiler: alpha-linux-gcc (GCC) 11.3.0
reproduce (cppcheck warning):
        # apt-get install cppcheck
        git checkout 49011e0c1555dd7a689d0f32fd78c1ecd43e59cd
        cppcheck --quiet --enable=style,performance,portability --template=gcc 
FILE

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <[email protected]>


cppcheck possible warnings: (new ones prefixed by >>, may not real problems)

>> drivers/net/phy/micrel.c:1537:9: warning: Uninitialized variable: ret 
>> [uninitvar]
    return ret;
           ^
   drivers/net/phy/micrel.c:1518:19: note: Assuming condition is false
    while (pair_mask && retries--) {
                     ^
   drivers/net/phy/micrel.c:1537:9: note: Uninitialized variable: ret
    return ret;
           ^

vim +1537 drivers/net/phy/micrel.c

49011e0c1555dd Oleksij Rempel 2021-06-14  1507  
49011e0c1555dd Oleksij Rempel 2021-06-14  1508  static int 
ksz886x_cable_test_get_status(struct phy_device *phydev,
49011e0c1555dd Oleksij Rempel 2021-06-14  1509                                  
         bool *finished)
49011e0c1555dd Oleksij Rempel 2021-06-14  1510  {
49011e0c1555dd Oleksij Rempel 2021-06-14  1511          unsigned long pair_mask 
= 0x3;
49011e0c1555dd Oleksij Rempel 2021-06-14  1512          int retries = 20;
49011e0c1555dd Oleksij Rempel 2021-06-14  1513          int pair, ret;
49011e0c1555dd Oleksij Rempel 2021-06-14  1514  
49011e0c1555dd Oleksij Rempel 2021-06-14  1515          *finished = false;
49011e0c1555dd Oleksij Rempel 2021-06-14  1516  
49011e0c1555dd Oleksij Rempel 2021-06-14  1517          /* Try harder if link 
partner is active */
49011e0c1555dd Oleksij Rempel 2021-06-14  1518          while (pair_mask && 
retries--) {
49011e0c1555dd Oleksij Rempel 2021-06-14  1519                  
for_each_set_bit(pair, &pair_mask, 4) {
49011e0c1555dd Oleksij Rempel 2021-06-14  1520                          ret = 
ksz886x_cable_test_one_pair(phydev, pair);
49011e0c1555dd Oleksij Rempel 2021-06-14  1521                          if (ret 
== -EAGAIN)
49011e0c1555dd Oleksij Rempel 2021-06-14  1522                                  
continue;
49011e0c1555dd Oleksij Rempel 2021-06-14  1523                          if (ret 
< 0)
49011e0c1555dd Oleksij Rempel 2021-06-14  1524                                  
return ret;
49011e0c1555dd Oleksij Rempel 2021-06-14  1525                          
clear_bit(pair, &pair_mask);
49011e0c1555dd Oleksij Rempel 2021-06-14  1526                  }
49011e0c1555dd Oleksij Rempel 2021-06-14  1527                  /* If link 
partner is in autonegotiation mode it will send 2ms
49011e0c1555dd Oleksij Rempel 2021-06-14  1528                   * of FLPs with 
at least 6ms of silence.
49011e0c1555dd Oleksij Rempel 2021-06-14  1529                   * Add 2ms 
sleep to have better chances to hit this silence.
49011e0c1555dd Oleksij Rempel 2021-06-14  1530                   */
49011e0c1555dd Oleksij Rempel 2021-06-14  1531                  if (pair_mask)
49011e0c1555dd Oleksij Rempel 2021-06-14  1532                          
msleep(2);
49011e0c1555dd Oleksij Rempel 2021-06-14  1533          }
49011e0c1555dd Oleksij Rempel 2021-06-14  1534  
49011e0c1555dd Oleksij Rempel 2021-06-14  1535          *finished = true;
49011e0c1555dd Oleksij Rempel 2021-06-14  1536  
49011e0c1555dd Oleksij Rempel 2021-06-14 @1537          return ret;
49011e0c1555dd Oleksij Rempel 2021-06-14  1538  }
49011e0c1555dd Oleksij Rempel 2021-06-14  1539  

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp
_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to