[arm:cex7 49/57] drivers/net/phy/qsfp.c:1366:20: warning: this statement may fall through

kernel test robot lkp at intel.com
Fri Sep 17 09:32:14 PDT 2021


tree:   git://git.armlinux.org.uk/~rmk/linux-arm.git cex7
head:   283e53483ea0458587598d170178e3b020c523bc
commit: ba8d435602640a13120f92800bf9197173e84df7 [49/57] net: add qsfp support                              [*experimental*]
config: arc-allyesconfig (attached as .config)
compiler: arceb-elf-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git remote add arm git://git.armlinux.org.uk/~rmk/linux-arm.git
        git fetch --no-tags arm cex7
        git checkout ba8d435602640a13120f92800bf9197173e84df7
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=arc 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp at intel.com>

All warnings (new ones prefixed by >>):

   drivers/net/phy/qsfp.c: In function 'qsfp_sm_main':
>> drivers/net/phy/qsfp.c:1366:20: warning: this statement may fall through [-Wimplicit-fallthrough=]
    1366 |                 if (qsfp_sm_power_up(qsfp))
         |                    ^
   drivers/net/phy/qsfp.c:1369:9: note: here
    1369 |         case SFP_S_WPOWER:
         |         ^~~~
   drivers/net/phy/qsfp.c:1370:52: warning: this statement may fall through [-Wimplicit-fallthrough=]
    1370 |                 if (qsfp->sm_state != SFP_S_WPOWER || event == SFP_E_TIMEOUT)
         |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/net/phy/qsfp.c:1374:9: note: here
    1374 |         case SFP_S_WTXEN:
         |         ^~~~


vim +1366 drivers/net/phy/qsfp.c

  1335	
  1336	static void qsfp_sm_main(struct qsfp *qsfp, unsigned int event)
  1337	{
  1338		if (qsfp->sm_mod_state != SFP_MOD_PRESENT ||
  1339		    qsfp->sm_dev_state != SFP_DEV_UP) {
  1340			if (qsfp->sm_state != SFP_S_DOWN) {
  1341				/* If we reported link up, and the upstream is
  1342				 * still up, report link down.
  1343				 */
  1344				if (qsfp->sm_state == SFP_S_LINK_UP &&
  1345				    qsfp->sm_dev_state == SFP_DEV_UP)
  1346					sfp_sm_link_down(qsfp);
  1347				/* If the module is still present, and we've
  1348				 * powered it up, power it back down.
  1349				 */
  1350				if (qsfp->sm_mod_state == SFP_MOD_PRESENT &&
  1351				    qsfp->sm_state >= SFP_S_WPOWER)
  1352					qsfp_sm_power_down(qsfp);
  1353				qsfp_sm_next(qsfp, SFP_S_DOWN, 0);
  1354			}
  1355			return;
  1356		}
  1357	
  1358		/* The main state machine - only entered when the upstream is up
  1359		 * and the module is present.
  1360		 */
  1361		switch (qsfp->sm_state) {
  1362		case SFP_S_ERROR:
  1363			break;
  1364	
  1365		case SFP_S_DOWN:
> 1366			if (qsfp_sm_power_up(qsfp))
  1367				break;
  1368			/* Fall through */
  1369		case SFP_S_WPOWER:
  1370			if (qsfp->sm_state != SFP_S_WPOWER || event == SFP_E_TIMEOUT)
  1371				if (sfp_sm_tx_enable(qsfp))
  1372					break;
  1373			/* Fall through */
  1374		case SFP_S_WTXEN:
  1375			if (qsfp->sm_state != SFP_S_WTXEN || event == SFP_E_TIMEOUT)
  1376				sfp_sm_init(qsfp);
  1377			break;
  1378	
  1379		case SFP_S_INIT:
  1380			if (event == SFP_E_TIMEOUT && qsfp->state & SFP_F_TX_FAULT)
  1381				sfp_sm_fault(qsfp, true);
  1382			else if (event == SFP_E_TIMEOUT || event == SFP_E_TX_CLEAR)
  1383				sfp_sm_link_check_los(qsfp);
  1384			break;
  1385	
  1386		case SFP_S_WAIT_LOS:
  1387			if (event == SFP_E_TX_FAULT)
  1388				sfp_sm_fault(qsfp, true);
  1389			else if (sfp_los_event_inactive(qsfp, event))
  1390				sfp_sm_link_up(qsfp);
  1391			break;
  1392	
  1393		case SFP_S_LINK_UP:
  1394			if (event == SFP_E_TX_FAULT) {
  1395				sfp_sm_link_down(qsfp);
  1396				sfp_sm_fault(qsfp, true);
  1397			} else if (sfp_los_event_active(qsfp, event)) {
  1398				sfp_sm_link_down(qsfp);
  1399				qsfp_sm_next(qsfp, SFP_S_WAIT_LOS, 0);
  1400			}
  1401			break;
  1402	
  1403		case SFP_S_TX_FAULT:
  1404			if (event == SFP_E_TIMEOUT) {
  1405				qsfp_sm_next(qsfp, SFP_S_REINIT, T_INIT_JIFFIES);
  1406			}
  1407			break;
  1408	
  1409		case SFP_S_REINIT:
  1410			if (event == SFP_E_TIMEOUT && qsfp->state & SFP_F_TX_FAULT) {
  1411				sfp_sm_fault(qsfp, false);
  1412			} else if (event == SFP_E_TIMEOUT || event == SFP_E_TX_CLEAR) {
  1413				dev_info(qsfp->dev, "module transmit fault recovered\n");
  1414				sfp_sm_link_check_los(qsfp);
  1415			}
  1416			break;
  1417	
  1418		case SFP_S_TX_DISABLE:
  1419			break;
  1420		}
  1421	
  1422		if (qsfp->current_tx_disable != qsfp->request_tx_disable &&
  1423		    qsfp->id.ext.sff8436.options[3] & SFF8X36_OPTIONS195_TX_DISABLE) {
  1424			qsfp->current_tx_disable = qsfp->request_tx_disable;
  1425	
  1426			if (qsfp_set_tx_disable(qsfp, qsfp->current_tx_disable) < 0)
  1427				qsfp_sm_next(qsfp, SFP_S_ERROR, 0);
  1428		}
  1429	}
  1430	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 68435 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20210918/088ca68f/attachment-0001.gz>


More information about the linux-arm-kernel mailing list