All of lore.kernel.org
 help / color / mirror / Atom feed
* [ti:ti-linux-5.4.y 3150/3255] drivers/net/ethernet/ti/j721e-cpsw-virt-mac.c:1333:5: warning: 'ret' may be used uninitialized in this function
@ 2020-02-07  8:59 kbuild test robot
  0 siblings, 0 replies; only message in thread
From: kbuild test robot @ 2020-02-07  8:59 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 4755 bytes --]

tree:   git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git ti-linux-5.4.y
head:   7ecc5b3dfa97c125d35a80e422fe1f21b2b8b008
commit: eb12e14a12cab8ff3ab67e8ec569213830797883 [3150/3255] net: ethernet: ti: introduce j721e virt cpsw-nuss mac driver
config: arm64-allmodconfig (attached as .config)
compiler: aarch64-linux-gcc (GCC) 7.5.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout eb12e14a12cab8ff3ab67e8ec569213830797883
        # save the attached .config to linux build tree
        GCC_VERSION=7.5.0 make.cross ARCH=arm64 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings

All warnings (new ones prefixed by >>):

   drivers/net/ethernet/ti/j721e-cpsw-virt-mac.c: In function 'virt_cpsw_nuss_probe':
>> drivers/net/ethernet/ti/j721e-cpsw-virt-mac.c:1333:5: warning: 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized]
     if (ret)
        ^

vim +/ret +1333 drivers/net/ethernet/ti/j721e-cpsw-virt-mac.c

  1289	
  1290	static int virt_cpsw_nuss_probe(struct platform_device *pdev)
  1291	{
  1292		struct device *dev = &pdev->dev;
  1293		struct virt_cpsw_common *common;
  1294		int ret;
  1295	
  1296		common = devm_kzalloc(dev, sizeof(struct virt_cpsw_common), GFP_KERNEL);
  1297		if (!common)
  1298			return -ENOMEM;
  1299		common->dev = dev;
  1300	
  1301		ret = of_property_read_string(dev->of_node, "ti,remote-name",
  1302					      &common->rdev_name);
  1303		if (ret < 0) {
  1304			dev_info(dev, "remote-name is not set %d\n", ret);
  1305			return ret;
  1306		}
  1307	
  1308		common->rdev = rpmsg_remotedev_get_named_device(common->rdev_name);
  1309		if (!common->rdev)
  1310			return -EPROBE_DEFER;
  1311		if (IS_ERR(common->rdev)) {
  1312			ret = PTR_ERR(common->rdev);
  1313			return ret;
  1314		}
  1315		common->rdev_switch_ops = common->rdev->device.eth_switch.ops;
  1316		ret = devm_add_action_or_reset(dev,
  1317					       (void(*)(void *))rpmsg_remotedev_put_device,
  1318					       common->rdev);
  1319		if (ret) {
  1320			dev_err(dev, "add remotedev put device action fail:%d", ret);
  1321			return ret;
  1322		}
  1323	
  1324		ret = virt_cpsw_nuss_of(common);
  1325		if (ret)
  1326			return ret;
  1327	
  1328		ret = virt_cpsw_nuss_rdev_init(common);
  1329		if (ret)
  1330			return ret;
  1331		/* init tx channels */
  1332		ret = virt_cpsw_nuss_init_tx_chns(common);
> 1333		if (ret)
  1334			return ret;
  1335		ret = virt_cpsw_nuss_init_rx_chns(common);
  1336		if (ret)
  1337			return ret;
  1338	
  1339		if (common->tx_chns.irq == 0 || common->rx_chns.irq == 0)
  1340			return -ENXIO;
  1341	
  1342		dev_set_drvdata(dev, common);
  1343	
  1344		ret = virt_cpsw_nuss_init_ndev(common);
  1345		if (ret)
  1346			return ret;
  1347	
  1348		ret = dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(48));
  1349		if (ret) {
  1350			dev_err(dev, "error setting dma mask: %d\n", ret);
  1351			goto unreg_ndev;
  1352		}
  1353	
  1354		ret = devm_request_irq(dev, common->tx_chns.irq,
  1355				       virt_cpsw_nuss_tx_irq,
  1356	
  1357				       0, dev_name(dev), common);
  1358		if (ret) {
  1359			dev_err(dev, "failure requesting tx irq %u, %d\n",
  1360				common->tx_chns.irq, ret);
  1361			goto unreg_ndev;
  1362		}
  1363	
  1364		ret = devm_request_irq(dev, common->rx_chns.irq,
  1365				       virt_cpsw_nuss_rx_irq,
  1366				       0, dev_name(dev), common);
  1367		if (ret) {
  1368			dev_err(dev, "failure requesting rx irq %u, %d\n",
  1369				common->rx_chns.irq, ret);
  1370			goto unreg_ndev;
  1371		}
  1372	
  1373		register_inetaddr_notifier(&virt_cpsw_inetaddr_nb);
  1374	
  1375		dev_info(common->dev, "virt_cpsw_nuss mac loaded\n");
  1376		dev_info(dev, "rdev_features:%08X rdev_mtu:%d flow_id:%d tx_psil_dst_id:%04X\n",
  1377			 common->rdev_features,
  1378			 common->rdev_mtu,
  1379			 common->rdev_rx_flow_id,
  1380			 common->rdev_tx_psil_dst_id);
  1381		dev_info(dev, "local_mac_addr:%pM rdev_mac_addr:%pM\n",
  1382			 common->ports.local_mac_addr,
  1383			 common->rdev_mac_addr);
  1384	
  1385		return 0;
  1386	
  1387	unreg_ndev:
  1388		virt_cpsw_nuss_cleanup_ndev(common);
  1389		return ret;
  1390	}
  1391	

---
0-DAY kernel test infrastructure                 Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org Intel Corporation

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 67499 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-02-07  8:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-07  8:59 [ti:ti-linux-5.4.y 3150/3255] drivers/net/ethernet/ti/j721e-cpsw-virt-mac.c:1333:5: warning: 'ret' may be used uninitialized in this function kbuild test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.