BCC: l...@intel.com
CC: kbuild-...@lists.01.org
CC: linux-ker...@vger.kernel.org
TO: "Alvin Šipraga" <a...@bang-olufsen.dk>

Hi Alvin,

First bad commit (maybe != root cause):

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   c40e8341e3b3bb27e3a65b06b5b454626234c4f0
commit: 2511e0c87786f333c4665508f421ac99e378c719 net: dsa: realtek: fix Kconfig 
to assure consistent driver linkage
date:   4 months ago
:::::: branch date: 11 hours ago
:::::: commit date: 4 months ago
config: openrisc-randconfig-m031-20220824 
(https://download.01.org/0day-ci/archive/20220824/202208242139.0eddbkzo-...@intel.com/config)
compiler: or1k-linux-gcc (GCC) 12.1.0

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <l...@intel.com>
Reported-by: Dan Carpenter <dan.carpen...@oracle.com>

smatch warnings:
drivers/net/dsa/realtek/rtl8365mb.c:1391 rtl8365mb_stats_update() error: 
uninitialized symbol 'ret'.

vim +/ret +1391 drivers/net/dsa/realtek/rtl8365mb.c

4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1348  
f5f119077b1cd6 drivers/net/dsa/realtek/rtl8365mb.c Luiz Angelo Daros de Luca 
2022-01-28  1349  static void rtl8365mb_stats_update(struct realtek_priv *priv, 
int port)
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1350  {
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1351   u64 cnt[RTL8365MB_MIB_END] = {
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1352           [RTL8365MB_MIB_ifOutOctets] = 1,
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1353           [RTL8365MB_MIB_ifOutUcastPkts] = 1,
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1354           [RTL8365MB_MIB_ifOutMulticastPkts] = 1,
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1355           [RTL8365MB_MIB_ifOutBroadcastPkts] = 1,
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1356           [RTL8365MB_MIB_ifOutDiscards] = 1,
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1357           [RTL8365MB_MIB_ifInOctets] = 1,
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1358           [RTL8365MB_MIB_ifInUcastPkts] = 1,
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1359           [RTL8365MB_MIB_ifInMulticastPkts] = 1,
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1360           [RTL8365MB_MIB_ifInBroadcastPkts] = 1,
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1361           [RTL8365MB_MIB_etherStatsDropEvents] = 1,
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1362           [RTL8365MB_MIB_etherStatsCollisions] = 1,
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1363           [RTL8365MB_MIB_etherStatsFragments] = 1,
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1364           [RTL8365MB_MIB_etherStatsJabbers] = 1,
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1365           [RTL8365MB_MIB_dot3StatsFCSErrors] = 1,
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1366           [RTL8365MB_MIB_dot3StatsLateCollisions] = 1,
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1367   };
f5f119077b1cd6 drivers/net/dsa/realtek/rtl8365mb.c Luiz Angelo Daros de Luca 
2022-01-28  1368   struct rtl8365mb *mb = priv->chip_data;
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1369   struct rtnl_link_stats64 *stats;
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1370   int ret;
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1371   int i;
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1372  
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1373   stats = &mb->ports[port].stats;
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1374  
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1375   mutex_lock(&mb->mib_lock);
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1376   for (i = 0; i < RTL8365MB_MIB_END; i++) {
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1377           struct rtl8365mb_mib_counter *c = 
&rtl8365mb_mib_counters[i];
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1378  
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1379           /* Only fetch required MIB counters (marked = 1 
above) */
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1380           if (!cnt[i])
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1381                   continue;
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1382  
f5f119077b1cd6 drivers/net/dsa/realtek/rtl8365mb.c Luiz Angelo Daros de Luca 
2022-01-28  1383           ret = rtl8365mb_mib_counter_read(priv, port, 
c->offset,
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1384                                            c->length, &cnt[i]);
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1385           if (ret)
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1386                   break;
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1387   }
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1388   mutex_unlock(&mb->mib_lock);
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1389  
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1390   /* Don't update statistics if there was an error reading the 
counters */
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18 @1391   if (ret)
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1392           return;
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1393  
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1394   spin_lock(&mb->ports[port].stats_lock);
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1395  
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1396   stats->rx_packets = cnt[RTL8365MB_MIB_ifInUcastPkts] +
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1397                       cnt[RTL8365MB_MIB_ifInMulticastPkts] +
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1398                       cnt[RTL8365MB_MIB_ifInBroadcastPkts] -
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1399                       cnt[RTL8365MB_MIB_ifOutDiscards];
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1400  
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1401   stats->tx_packets = cnt[RTL8365MB_MIB_ifOutUcastPkts] +
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1402                       cnt[RTL8365MB_MIB_ifOutMulticastPkts] +
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1403                       cnt[RTL8365MB_MIB_ifOutBroadcastPkts];
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1404  
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1405   /* if{In,Out}Octets includes FCS - remove it */
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1406   stats->rx_bytes = cnt[RTL8365MB_MIB_ifInOctets] - 4 * 
stats->rx_packets;
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1407   stats->tx_bytes =
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1408           cnt[RTL8365MB_MIB_ifOutOctets] - 4 * 
stats->tx_packets;
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1409  
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1410   stats->rx_dropped = cnt[RTL8365MB_MIB_etherStatsDropEvents];
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1411   stats->tx_dropped = cnt[RTL8365MB_MIB_ifOutDiscards];
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1412  
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1413   stats->multicast = cnt[RTL8365MB_MIB_ifInMulticastPkts];
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1414   stats->collisions = cnt[RTL8365MB_MIB_etherStatsCollisions];
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1415  
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1416   stats->rx_length_errors = 
cnt[RTL8365MB_MIB_etherStatsFragments] +
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1417                             
cnt[RTL8365MB_MIB_etherStatsJabbers];
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1418   stats->rx_crc_errors = cnt[RTL8365MB_MIB_dot3StatsFCSErrors];
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1419   stats->rx_errors = stats->rx_length_errors + 
stats->rx_crc_errors;
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1420  
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1421   stats->tx_aborted_errors = cnt[RTL8365MB_MIB_ifOutDiscards];
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1422   stats->tx_window_errors = 
cnt[RTL8365MB_MIB_dot3StatsLateCollisions];
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1423   stats->tx_errors = stats->tx_aborted_errors + 
stats->tx_window_errors;
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1424  
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1425   spin_unlock(&mb->ports[port].stats_lock);
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1426  }
4af2950c50c863 drivers/net/dsa/rtl8365mb.c         Alvin Šipraga             
2021-10-18  1427  

:::::: The code at line 1391 was first introduced by commit
:::::: 4af2950c50c8634ed2865cf81e607034f78b84aa net: dsa: realtek-smi: add 
rtl8365mb subdriver for RTL8365MB-VC

:::::: TO: Alvin Šipraga <a...@bang-olufsen.dk>
:::::: CC: David S. Miller <da...@davemloft.net>

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

Reply via email to