Re: [PATCH v2 3/8] net: macb: add function to disable all macb clocks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Claudiu,

I love your patch! Perhaps something to improve:

[auto build test WARNING on robh/for-next]
[also build test WARNING on net-next/master net/master linus/master v5.10-rc7 next-20201208]
[cannot apply to sparc-next/master]
[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]

url:    https://github.com/0day-ci/linux/commits/Claudiu-Beznea/net-macb-add-support-for-sama7g5/20201207-201959
base:   https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
config: arm64-randconfig-r021-20201208 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 1968804ac726e7674d5de22bc2204b45857da344)
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
        # install arm64 cross compiling tool for clang build
        # apt-get install binutils-aarch64-linux-gnu
        # https://github.com/0day-ci/linux/commit/7a9fff9938fe9b459aa67f4afb0e817313d3d54a
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Claudiu-Beznea/net-macb-add-support-for-sama7g5/20201207-201959
        git checkout 7a9fff9938fe9b459aa67f4afb0e817313d3d54a
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

>> drivers/net/ethernet/cadence/macb_main.c:4506:6: warning: variable 'bp' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
           if (!dev) {
               ^~~~
   drivers/net/ethernet/cadence/macb_main.c:4641:20: note: uninitialized use occurs here
           macb_clks_disable(bp->pclk, bp->hclk, bp->tx_clk, bp->rx_clk, bp->tsu_clk);
                             ^~
   drivers/net/ethernet/cadence/macb_main.c:4506:2: note: remove the 'if' if its condition is always false
           if (!dev) {
           ^~~~~~~~~~~
   drivers/net/ethernet/cadence/macb_main.c:4474:17: note: initialize the variable 'bp' to silence this warning
           struct macb *bp;
                          ^
                           = NULL
   1 warning generated.

vim +4506 drivers/net/ethernet/cadence/macb_main.c

83a77e9ec4150e drivers/net/ethernet/cadence/macb.c      Bartosz Folta                 2016-12-14  4456  
421d9df0628be1 drivers/net/ethernet/cadence/macb.c      Cyrille Pitchen               2015-03-07  4457  static int macb_probe(struct platform_device *pdev)
421d9df0628be1 drivers/net/ethernet/cadence/macb.c      Cyrille Pitchen               2015-03-07  4458  {
83a77e9ec4150e drivers/net/ethernet/cadence/macb.c      Bartosz Folta                 2016-12-14  4459  	const struct macb_config *macb_config = &default_gem_config;
c69618b3e4f220 drivers/net/ethernet/cadence/macb.c      Nicolas Ferre                 2015-03-31  4460  	int (*clk_init)(struct platform_device *, struct clk **,
f5473d1d44e4b4 drivers/net/ethernet/cadence/macb_main.c Harini Katakam                2019-03-01  4461  			struct clk **, struct clk **,  struct clk **,
f5473d1d44e4b4 drivers/net/ethernet/cadence/macb_main.c Harini Katakam                2019-03-01  4462  			struct clk **) = macb_config->clk_init;
83a77e9ec4150e drivers/net/ethernet/cadence/macb.c      Bartosz Folta                 2016-12-14  4463  	int (*init)(struct platform_device *) = macb_config->init;
421d9df0628be1 drivers/net/ethernet/cadence/macb.c      Cyrille Pitchen               2015-03-07  4464  	struct device_node *np = pdev->dev.of_node;
aead88bd0e9905 drivers/net/ethernet/cadence/macb.c      shubhrajyoti.datta@xxxxxxxxxx 2016-08-16  4465  	struct clk *pclk, *hclk = NULL, *tx_clk = NULL, *rx_clk = NULL;
f5473d1d44e4b4 drivers/net/ethernet/cadence/macb_main.c Harini Katakam                2019-03-01  4466  	struct clk *tsu_clk = NULL;
421d9df0628be1 drivers/net/ethernet/cadence/macb.c      Cyrille Pitchen               2015-03-07  4467  	unsigned int queue_mask, num_queues;
f2ce8a9e48385f drivers/net/ethernet/cadence/macb.c      Andy Shevchenko               2015-07-24  4468  	bool native_io;
0c65b2b90d13c1 drivers/net/ethernet/cadence/macb_main.c Andrew Lunn                   2019-11-04  4469  	phy_interface_t interface;
421d9df0628be1 drivers/net/ethernet/cadence/macb.c      Cyrille Pitchen               2015-03-07  4470  	struct net_device *dev;
421d9df0628be1 drivers/net/ethernet/cadence/macb.c      Cyrille Pitchen               2015-03-07  4471  	struct resource *regs;
421d9df0628be1 drivers/net/ethernet/cadence/macb.c      Cyrille Pitchen               2015-03-07  4472  	void __iomem *mem;
421d9df0628be1 drivers/net/ethernet/cadence/macb.c      Cyrille Pitchen               2015-03-07  4473  	const char *mac;
421d9df0628be1 drivers/net/ethernet/cadence/macb.c      Cyrille Pitchen               2015-03-07  4474  	struct macb *bp;
404cd086f29e86 drivers/net/ethernet/cadence/macb_main.c Harini Katakam                2018-07-06  4475  	int err, val;
421d9df0628be1 drivers/net/ethernet/cadence/macb.c      Cyrille Pitchen               2015-03-07  4476  
f2ce8a9e48385f drivers/net/ethernet/cadence/macb.c      Andy Shevchenko               2015-07-24  4477  	regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
f2ce8a9e48385f drivers/net/ethernet/cadence/macb.c      Andy Shevchenko               2015-07-24  4478  	mem = devm_ioremap_resource(&pdev->dev, regs);
f2ce8a9e48385f drivers/net/ethernet/cadence/macb.c      Andy Shevchenko               2015-07-24  4479  	if (IS_ERR(mem))
f2ce8a9e48385f drivers/net/ethernet/cadence/macb.c      Andy Shevchenko               2015-07-24  4480  		return PTR_ERR(mem);
f2ce8a9e48385f drivers/net/ethernet/cadence/macb.c      Andy Shevchenko               2015-07-24  4481  
c69618b3e4f220 drivers/net/ethernet/cadence/macb.c      Nicolas Ferre                 2015-03-31  4482  	if (np) {
c69618b3e4f220 drivers/net/ethernet/cadence/macb.c      Nicolas Ferre                 2015-03-31  4483  		const struct of_device_id *match;
c69618b3e4f220 drivers/net/ethernet/cadence/macb.c      Nicolas Ferre                 2015-03-31  4484  
c69618b3e4f220 drivers/net/ethernet/cadence/macb.c      Nicolas Ferre                 2015-03-31  4485  		match = of_match_node(macb_dt_ids, np);
c69618b3e4f220 drivers/net/ethernet/cadence/macb.c      Nicolas Ferre                 2015-03-31  4486  		if (match && match->data) {
c69618b3e4f220 drivers/net/ethernet/cadence/macb.c      Nicolas Ferre                 2015-03-31  4487  			macb_config = match->data;
c69618b3e4f220 drivers/net/ethernet/cadence/macb.c      Nicolas Ferre                 2015-03-31  4488  			clk_init = macb_config->clk_init;
c69618b3e4f220 drivers/net/ethernet/cadence/macb.c      Nicolas Ferre                 2015-03-31  4489  			init = macb_config->init;
c69618b3e4f220 drivers/net/ethernet/cadence/macb.c      Nicolas Ferre                 2015-03-31  4490  		}
c69618b3e4f220 drivers/net/ethernet/cadence/macb.c      Nicolas Ferre                 2015-03-31  4491  	}
c69618b3e4f220 drivers/net/ethernet/cadence/macb.c      Nicolas Ferre                 2015-03-31  4492  
f5473d1d44e4b4 drivers/net/ethernet/cadence/macb_main.c Harini Katakam                2019-03-01  4493  	err = clk_init(pdev, &pclk, &hclk, &tx_clk, &rx_clk, &tsu_clk);
c69618b3e4f220 drivers/net/ethernet/cadence/macb.c      Nicolas Ferre                 2015-03-31  4494  	if (err)
c69618b3e4f220 drivers/net/ethernet/cadence/macb.c      Nicolas Ferre                 2015-03-31  4495  		return err;
c69618b3e4f220 drivers/net/ethernet/cadence/macb.c      Nicolas Ferre                 2015-03-31  4496  
d54f89af6cc4d6 drivers/net/ethernet/cadence/macb_main.c Harini Katakam                2019-03-01  4497  	pm_runtime_set_autosuspend_delay(&pdev->dev, MACB_PM_TIMEOUT);
d54f89af6cc4d6 drivers/net/ethernet/cadence/macb_main.c Harini Katakam                2019-03-01  4498  	pm_runtime_use_autosuspend(&pdev->dev);
d54f89af6cc4d6 drivers/net/ethernet/cadence/macb_main.c Harini Katakam                2019-03-01  4499  	pm_runtime_get_noresume(&pdev->dev);
d54f89af6cc4d6 drivers/net/ethernet/cadence/macb_main.c Harini Katakam                2019-03-01  4500  	pm_runtime_set_active(&pdev->dev);
d54f89af6cc4d6 drivers/net/ethernet/cadence/macb_main.c Harini Katakam                2019-03-01  4501  	pm_runtime_enable(&pdev->dev);
f2ce8a9e48385f drivers/net/ethernet/cadence/macb.c      Andy Shevchenko               2015-07-24  4502  	native_io = hw_is_native_io(mem);
421d9df0628be1 drivers/net/ethernet/cadence/macb.c      Cyrille Pitchen               2015-03-07  4503  
f2ce8a9e48385f drivers/net/ethernet/cadence/macb.c      Andy Shevchenko               2015-07-24  4504  	macb_probe_queues(mem, native_io, &queue_mask, &num_queues);
421d9df0628be1 drivers/net/ethernet/cadence/macb.c      Cyrille Pitchen               2015-03-07  4505  	dev = alloc_etherdev_mq(sizeof(*bp), num_queues);
c69618b3e4f220 drivers/net/ethernet/cadence/macb.c      Nicolas Ferre                 2015-03-31 @4506  	if (!dev) {
c69618b3e4f220 drivers/net/ethernet/cadence/macb.c      Nicolas Ferre                 2015-03-31  4507  		err = -ENOMEM;
c69618b3e4f220 drivers/net/ethernet/cadence/macb.c      Nicolas Ferre                 2015-03-31  4508  		goto err_disable_clocks;
c69618b3e4f220 drivers/net/ethernet/cadence/macb.c      Nicolas Ferre                 2015-03-31  4509  	}
421d9df0628be1 drivers/net/ethernet/cadence/macb.c      Cyrille Pitchen               2015-03-07  4510  
421d9df0628be1 drivers/net/ethernet/cadence/macb.c      Cyrille Pitchen               2015-03-07  4511  	dev->base_addr = regs->start;
421d9df0628be1 drivers/net/ethernet/cadence/macb.c      Cyrille Pitchen               2015-03-07  4512  
421d9df0628be1 drivers/net/ethernet/cadence/macb.c      Cyrille Pitchen               2015-03-07  4513  	SET_NETDEV_DEV(dev, &pdev->dev);
421d9df0628be1 drivers/net/ethernet/cadence/macb.c      Cyrille Pitchen               2015-03-07  4514  
421d9df0628be1 drivers/net/ethernet/cadence/macb.c      Cyrille Pitchen               2015-03-07  4515  	bp = netdev_priv(dev);
421d9df0628be1 drivers/net/ethernet/cadence/macb.c      Cyrille Pitchen               2015-03-07  4516  	bp->pdev = pdev;
421d9df0628be1 drivers/net/ethernet/cadence/macb.c      Cyrille Pitchen               2015-03-07  4517  	bp->dev = dev;
421d9df0628be1 drivers/net/ethernet/cadence/macb.c      Cyrille Pitchen               2015-03-07  4518  	bp->regs = mem;
f2ce8a9e48385f drivers/net/ethernet/cadence/macb.c      Andy Shevchenko               2015-07-24  4519  	bp->native_io = native_io;
f2ce8a9e48385f drivers/net/ethernet/cadence/macb.c      Andy Shevchenko               2015-07-24  4520  	if (native_io) {
7a6e0706c09b12 drivers/net/ethernet/cadence/macb.c      David S. Miller               2015-07-27  4521  		bp->macb_reg_readl = hw_readl_native;
7a6e0706c09b12 drivers/net/ethernet/cadence/macb.c      David S. Miller               2015-07-27  4522  		bp->macb_reg_writel = hw_writel_native;
f2ce8a9e48385f drivers/net/ethernet/cadence/macb.c      Andy Shevchenko               2015-07-24  4523  	} else {
7a6e0706c09b12 drivers/net/ethernet/cadence/macb.c      David S. Miller               2015-07-27  4524  		bp->macb_reg_readl = hw_readl;
7a6e0706c09b12 drivers/net/ethernet/cadence/macb.c      David S. Miller               2015-07-27  4525  		bp->macb_reg_writel = hw_writel;
f2ce8a9e48385f drivers/net/ethernet/cadence/macb.c      Andy Shevchenko               2015-07-24  4526  	}
421d9df0628be1 drivers/net/ethernet/cadence/macb.c      Cyrille Pitchen               2015-03-07  4527  	bp->num_queues = num_queues;
bfa0914afa95d4 drivers/net/ethernet/cadence/macb.c      Nicolas Ferre                 2015-03-31  4528  	bp->queue_mask = queue_mask;
c69618b3e4f220 drivers/net/ethernet/cadence/macb.c      Nicolas Ferre                 2015-03-31  4529  	if (macb_config)
f6970505defd0e drivers/net/ethernet/cadence/macb.c      Nicolas Ferre                 2015-03-31  4530  		bp->dma_burst_length = macb_config->dma_burst_length;
c69618b3e4f220 drivers/net/ethernet/cadence/macb.c      Nicolas Ferre                 2015-03-31  4531  	bp->pclk = pclk;
c69618b3e4f220 drivers/net/ethernet/cadence/macb.c      Nicolas Ferre                 2015-03-31  4532  	bp->hclk = hclk;
c69618b3e4f220 drivers/net/ethernet/cadence/macb.c      Nicolas Ferre                 2015-03-31  4533  	bp->tx_clk = tx_clk;
aead88bd0e9905 drivers/net/ethernet/cadence/macb.c      shubhrajyoti.datta@xxxxxxxxxx 2016-08-16  4534  	bp->rx_clk = rx_clk;
f5473d1d44e4b4 drivers/net/ethernet/cadence/macb_main.c Harini Katakam                2019-03-01  4535  	bp->tsu_clk = tsu_clk;
f36dbe6a285e06 drivers/net/ethernet/cadence/macb.c      Andy Shevchenko               2015-07-24  4536  	if (macb_config)
98b5a0f4a2282f drivers/net/ethernet/cadence/macb.c      Harini Katakam                2015-05-06  4537  		bp->jumbo_max_len = macb_config->jumbo_max_len;
98b5a0f4a2282f drivers/net/ethernet/cadence/macb.c      Harini Katakam                2015-05-06  4538  
3e2a5e15390643 drivers/net/ethernet/cadence/macb.c      Sergio Prado                  2016-02-09  4539  	bp->wol = 0;
7c4a1d0cfdc169 drivers/net/ethernet/cadence/macb.c      Sergio Prado                  2016-02-16  4540  	if (of_get_property(np, "magic-packet", NULL))
3e2a5e15390643 drivers/net/ethernet/cadence/macb.c      Sergio Prado                  2016-02-09  4541  		bp->wol |= MACB_WOL_HAS_MAGIC_PACKET;
ced4799d063759 drivers/net/ethernet/cadence/macb_main.c Nicolas Ferre                 2020-07-10  4542  	device_set_wakeup_capable(&pdev->dev, bp->wol & MACB_WOL_HAS_MAGIC_PACKET);
3e2a5e15390643 drivers/net/ethernet/cadence/macb.c      Sergio Prado                  2016-02-09  4543  
5c14e373350d7e drivers/net/ethernet/cadence/macb_main.c Claudiu Beznea                2020-12-07  4544  	bp->usrio = macb_config->usrio;
5c14e373350d7e drivers/net/ethernet/cadence/macb_main.c Claudiu Beznea                2020-12-07  4545  
c69618b3e4f220 drivers/net/ethernet/cadence/macb.c      Nicolas Ferre                 2015-03-31  4546  	spin_lock_init(&bp->lock);
f6970505defd0e drivers/net/ethernet/cadence/macb.c      Nicolas Ferre                 2015-03-31  4547  
ad78347f06581e drivers/net/ethernet/cadence/macb.c      Nicolas Ferre                 2015-03-31  4548  	/* setup capabilities */
f6970505defd0e drivers/net/ethernet/cadence/macb.c      Nicolas Ferre                 2015-03-31  4549  	macb_configure_caps(bp, macb_config);
f6970505defd0e drivers/net/ethernet/cadence/macb.c      Nicolas Ferre                 2015-03-31  4550  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux