public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
* Re: [PATCH 2/3] soc: ti: knav_qmss_queue: do device_node auto cleanup
       [not found] <20240510071432.62913-3-five231003@gmail.com>
@ 2024-05-11 10:12 ` kernel test robot
  2024-05-12 10:26   ` Kousik Sanagavarapu
  0 siblings, 1 reply; 6+ messages in thread
From: kernel test robot @ 2024-05-11 10:12 UTC (permalink / raw)
  To: Kousik Sanagavarapu, Nishanth Menon, Santosh Shilimkar,
	Julia Lawall
  Cc: llvm, oe-kbuild-all, Shuah Khan, Javier Carrasco, linux-kernel,
	linux-arm-kernel, Kousik Sanagavarapu

Hi Kousik,

kernel test robot noticed the following build errors:

[auto build test ERROR on clk/clk-next]
[also build test ERROR on soc/for-next linus/master v6.9-rc7 next-20240510]
[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#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Kousik-Sanagavarapu/soc-ti-pruss-do-device_node-auto-cleanup/20240510-151656
base:   https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git clk-next
patch link:    https://lore.kernel.org/r/20240510071432.62913-3-five231003%40gmail.com
patch subject: [PATCH 2/3] soc: ti: knav_qmss_queue: do device_node auto cleanup
config: arm-defconfig (https://download.01.org/0day-ci/archive/20240511/202405111846.3m9z398l-lkp@intel.com/config)
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240511/202405111846.3m9z398l-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202405111846.3m9z398l-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/soc/ti/knav_qmss_queue.c:1853:3: error: cannot jump from this goto statement to its label
                   goto err;
                   ^
   drivers/soc/ti/knav_qmss_queue.c:1855:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
           struct device_node *regions __free(device_node) =
                               ^
   drivers/soc/ti/knav_qmss_queue.c:1840:3: error: cannot jump from this goto statement to its label
                   goto err;
                   ^
   drivers/soc/ti/knav_qmss_queue.c:1855:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
           struct device_node *regions __free(device_node) =
                               ^
   drivers/soc/ti/knav_qmss_queue.c:1835:3: error: cannot jump from this goto statement to its label
                   goto err;
                   ^
   drivers/soc/ti/knav_qmss_queue.c:1855:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
           struct device_node *regions __free(device_node) =
                               ^
   drivers/soc/ti/knav_qmss_queue.c:1831:3: error: cannot jump from this goto statement to its label
                   goto err;
                   ^
   drivers/soc/ti/knav_qmss_queue.c:1855:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
           struct device_node *regions __free(device_node) =
                               ^
   drivers/soc/ti/knav_qmss_queue.c:1822:4: error: cannot jump from this goto statement to its label
                           goto err;
                           ^
   drivers/soc/ti/knav_qmss_queue.c:1855:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
           struct device_node *regions __free(device_node) =
                               ^
   drivers/soc/ti/knav_qmss_queue.c:1826:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
           struct device_node *queue_pools __free(device_node) =
                               ^
   drivers/soc/ti/knav_qmss_queue.c:1818:4: error: cannot jump from this goto statement to its label
                           goto err;
                           ^
   drivers/soc/ti/knav_qmss_queue.c:1855:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
           struct device_node *regions __free(device_node) =
                               ^
   drivers/soc/ti/knav_qmss_queue.c:1826:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
           struct device_node *queue_pools __free(device_node) =
                               ^
   drivers/soc/ti/knav_qmss_queue.c:1810:3: error: cannot jump from this goto statement to its label
                   goto err;
                   ^
   drivers/soc/ti/knav_qmss_queue.c:1855:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
           struct device_node *regions __free(device_node) =
                               ^
   drivers/soc/ti/knav_qmss_queue.c:1826:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
           struct device_node *queue_pools __free(device_node) =
                               ^
   drivers/soc/ti/knav_qmss_queue.c:1813:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
           struct device_node *pdsps __free(device_node) =
                               ^
   drivers/soc/ti/knav_qmss_queue.c:1806:3: error: cannot jump from this goto statement to its label
                   goto err;
                   ^
   drivers/soc/ti/knav_qmss_queue.c:1855:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
           struct device_node *regions __free(device_node) =
                               ^
   drivers/soc/ti/knav_qmss_queue.c:1826:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
           struct device_node *queue_pools __free(device_node) =
                               ^
   drivers/soc/ti/knav_qmss_queue.c:1813:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
           struct device_node *pdsps __free(device_node) =
                               ^
   drivers/soc/ti/knav_qmss_queue.c:1795:3: error: cannot jump from this goto statement to its label
                   goto err;
                   ^
   drivers/soc/ti/knav_qmss_queue.c:1855:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
           struct device_node *regions __free(device_node) =
                               ^
   drivers/soc/ti/knav_qmss_queue.c:1826:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
           struct device_node *queue_pools __free(device_node) =
                               ^
   drivers/soc/ti/knav_qmss_queue.c:1813:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
           struct device_node *pdsps __free(device_node) =
                               ^
   drivers/soc/ti/knav_qmss_queue.c:1801:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
           struct device_node *qmgrs __free(device_node) =
                               ^
   9 errors generated.


vim +1853 drivers/soc/ti/knav_qmss_queue.c

350601b4f7ab45 Murali Karicheri    2018-04-17  1754  
41f93af900a20d Sandeep Nair        2014-02-28  1755  static int knav_queue_probe(struct platform_device *pdev)
41f93af900a20d Sandeep Nair        2014-02-28  1756  {
41f93af900a20d Sandeep Nair        2014-02-28  1757  	struct device_node *node = pdev->dev.of_node;
41f93af900a20d Sandeep Nair        2014-02-28  1758  	struct device *dev = &pdev->dev;
41f93af900a20d Sandeep Nair        2014-02-28  1759  	u32 temp[2];
41f93af900a20d Sandeep Nair        2014-02-28  1760  	int ret;
41f93af900a20d Sandeep Nair        2014-02-28  1761  
41f93af900a20d Sandeep Nair        2014-02-28  1762  	if (!node) {
41f93af900a20d Sandeep Nair        2014-02-28  1763  		dev_err(dev, "device tree info unavailable\n");
41f93af900a20d Sandeep Nair        2014-02-28  1764  		return -ENODEV;
41f93af900a20d Sandeep Nair        2014-02-28  1765  	}
41f93af900a20d Sandeep Nair        2014-02-28  1766  
41f93af900a20d Sandeep Nair        2014-02-28  1767  	kdev = devm_kzalloc(dev, sizeof(struct knav_device), GFP_KERNEL);
41f93af900a20d Sandeep Nair        2014-02-28  1768  	if (!kdev) {
41f93af900a20d Sandeep Nair        2014-02-28  1769  		dev_err(dev, "memory allocation failed\n");
41f93af900a20d Sandeep Nair        2014-02-28  1770  		return -ENOMEM;
41f93af900a20d Sandeep Nair        2014-02-28  1771  	}
41f93af900a20d Sandeep Nair        2014-02-28  1772  
50c01a942b2874 Rob Herring         2023-10-09  1773  	if (device_get_match_data(dev))
350601b4f7ab45 Murali Karicheri    2018-04-17  1774  		kdev->version = QMSS_66AK2G;
350601b4f7ab45 Murali Karicheri    2018-04-17  1775  
41f93af900a20d Sandeep Nair        2014-02-28  1776  	platform_set_drvdata(pdev, kdev);
41f93af900a20d Sandeep Nair        2014-02-28  1777  	kdev->dev = dev;
41f93af900a20d Sandeep Nair        2014-02-28  1778  	INIT_LIST_HEAD(&kdev->queue_ranges);
41f93af900a20d Sandeep Nair        2014-02-28  1779  	INIT_LIST_HEAD(&kdev->qmgrs);
41f93af900a20d Sandeep Nair        2014-02-28  1780  	INIT_LIST_HEAD(&kdev->pools);
41f93af900a20d Sandeep Nair        2014-02-28  1781  	INIT_LIST_HEAD(&kdev->regions);
41f93af900a20d Sandeep Nair        2014-02-28  1782  	INIT_LIST_HEAD(&kdev->pdsps);
41f93af900a20d Sandeep Nair        2014-02-28  1783  
41f93af900a20d Sandeep Nair        2014-02-28  1784  	pm_runtime_enable(&pdev->dev);
12eeb74925da70 Minghao Chi         2022-04-18  1785  	ret = pm_runtime_resume_and_get(&pdev->dev);
41f93af900a20d Sandeep Nair        2014-02-28  1786  	if (ret < 0) {
e961c0f19450fd Zhang Qilong        2022-11-08  1787  		pm_runtime_disable(&pdev->dev);
41f93af900a20d Sandeep Nair        2014-02-28  1788  		dev_err(dev, "Failed to enable QMSS\n");
41f93af900a20d Sandeep Nair        2014-02-28  1789  		return ret;
41f93af900a20d Sandeep Nair        2014-02-28  1790  	}
41f93af900a20d Sandeep Nair        2014-02-28  1791  
41f93af900a20d Sandeep Nair        2014-02-28  1792  	if (of_property_read_u32_array(node, "queue-range", temp, 2)) {
41f93af900a20d Sandeep Nair        2014-02-28  1793  		dev_err(dev, "queue-range not specified\n");
41f93af900a20d Sandeep Nair        2014-02-28  1794  		ret = -ENODEV;
41f93af900a20d Sandeep Nair        2014-02-28  1795  		goto err;
41f93af900a20d Sandeep Nair        2014-02-28  1796  	}
41f93af900a20d Sandeep Nair        2014-02-28  1797  	kdev->base_id    = temp[0];
41f93af900a20d Sandeep Nair        2014-02-28  1798  	kdev->num_queues = temp[1];
41f93af900a20d Sandeep Nair        2014-02-28  1799  
41f93af900a20d Sandeep Nair        2014-02-28  1800  	/* Initialize queue managers using device tree configuration */
10e6f93cca367b Kousik Sanagavarapu 2024-05-10  1801  	struct device_node *qmgrs __free(device_node) =
10e6f93cca367b Kousik Sanagavarapu 2024-05-10  1802  			of_get_child_by_name(node, "qmgrs");
41f93af900a20d Sandeep Nair        2014-02-28  1803  	if (!qmgrs) {
41f93af900a20d Sandeep Nair        2014-02-28  1804  		dev_err(dev, "queue manager info not specified\n");
41f93af900a20d Sandeep Nair        2014-02-28  1805  		ret = -ENODEV;
41f93af900a20d Sandeep Nair        2014-02-28  1806  		goto err;
41f93af900a20d Sandeep Nair        2014-02-28  1807  	}
41f93af900a20d Sandeep Nair        2014-02-28  1808  	ret = knav_queue_init_qmgrs(kdev, qmgrs);
41f93af900a20d Sandeep Nair        2014-02-28  1809  	if (ret)
41f93af900a20d Sandeep Nair        2014-02-28  1810  		goto err;
41f93af900a20d Sandeep Nair        2014-02-28  1811  
41f93af900a20d Sandeep Nair        2014-02-28  1812  	/* get pdsp configuration values from device tree */
10e6f93cca367b Kousik Sanagavarapu 2024-05-10  1813  	struct device_node *pdsps __free(device_node) =
10e6f93cca367b Kousik Sanagavarapu 2024-05-10  1814  			of_get_child_by_name(node, "pdsps");
41f93af900a20d Sandeep Nair        2014-02-28  1815  	if (pdsps) {
41f93af900a20d Sandeep Nair        2014-02-28  1816  		ret = knav_queue_init_pdsps(kdev, pdsps);
41f93af900a20d Sandeep Nair        2014-02-28  1817  		if (ret)
41f93af900a20d Sandeep Nair        2014-02-28  1818  			goto err;
41f93af900a20d Sandeep Nair        2014-02-28  1819  
41f93af900a20d Sandeep Nair        2014-02-28  1820  		ret = knav_queue_start_pdsps(kdev);
41f93af900a20d Sandeep Nair        2014-02-28  1821  		if (ret)
41f93af900a20d Sandeep Nair        2014-02-28  1822  			goto err;
41f93af900a20d Sandeep Nair        2014-02-28  1823  	}
41f93af900a20d Sandeep Nair        2014-02-28  1824  
41f93af900a20d Sandeep Nair        2014-02-28  1825  	/* get usable queue range values from device tree */
10e6f93cca367b Kousik Sanagavarapu 2024-05-10  1826  	struct device_node *queue_pools __free(device_node) =
10e6f93cca367b Kousik Sanagavarapu 2024-05-10  1827  			of_get_child_by_name(node, "queue-pools");
41f93af900a20d Sandeep Nair        2014-02-28  1828  	if (!queue_pools) {
41f93af900a20d Sandeep Nair        2014-02-28  1829  		dev_err(dev, "queue-pools not specified\n");
41f93af900a20d Sandeep Nair        2014-02-28  1830  		ret = -ENODEV;
41f93af900a20d Sandeep Nair        2014-02-28  1831  		goto err;
41f93af900a20d Sandeep Nair        2014-02-28  1832  	}
41f93af900a20d Sandeep Nair        2014-02-28  1833  	ret = knav_setup_queue_pools(kdev, queue_pools);
41f93af900a20d Sandeep Nair        2014-02-28  1834  	if (ret)
41f93af900a20d Sandeep Nair        2014-02-28  1835  		goto err;
41f93af900a20d Sandeep Nair        2014-02-28  1836  
41f93af900a20d Sandeep Nair        2014-02-28  1837  	ret = knav_get_link_ram(kdev, "linkram0", &kdev->link_rams[0]);
41f93af900a20d Sandeep Nair        2014-02-28  1838  	if (ret) {
41f93af900a20d Sandeep Nair        2014-02-28  1839  		dev_err(kdev->dev, "could not setup linking ram\n");
41f93af900a20d Sandeep Nair        2014-02-28  1840  		goto err;
41f93af900a20d Sandeep Nair        2014-02-28  1841  	}
41f93af900a20d Sandeep Nair        2014-02-28  1842  
41f93af900a20d Sandeep Nair        2014-02-28  1843  	ret = knav_get_link_ram(kdev, "linkram1", &kdev->link_rams[1]);
41f93af900a20d Sandeep Nair        2014-02-28  1844  	if (ret) {
41f93af900a20d Sandeep Nair        2014-02-28  1845  		/*
41f93af900a20d Sandeep Nair        2014-02-28  1846  		 * nothing really, we have one linking ram already, so we just
41f93af900a20d Sandeep Nair        2014-02-28  1847  		 * live within our means
41f93af900a20d Sandeep Nair        2014-02-28  1848  		 */
41f93af900a20d Sandeep Nair        2014-02-28  1849  	}
41f93af900a20d Sandeep Nair        2014-02-28  1850  
41f93af900a20d Sandeep Nair        2014-02-28  1851  	ret = knav_queue_setup_link_ram(kdev);
41f93af900a20d Sandeep Nair        2014-02-28  1852  	if (ret)
41f93af900a20d Sandeep Nair        2014-02-28 @1853  		goto err;
41f93af900a20d Sandeep Nair        2014-02-28  1854  
10e6f93cca367b Kousik Sanagavarapu 2024-05-10  1855  	struct device_node *regions __free(device_node) =
10e6f93cca367b Kousik Sanagavarapu 2024-05-10  1856  			of_get_child_by_name(node, "descriptor-regions");
41f93af900a20d Sandeep Nair        2014-02-28  1857  	if (!regions) {
41f93af900a20d Sandeep Nair        2014-02-28  1858  		dev_err(dev, "descriptor-regions not specified\n");
4cba398f37f868 Zhihao Cheng        2020-11-21  1859  		ret = -ENODEV;
41f93af900a20d Sandeep Nair        2014-02-28  1860  		goto err;
41f93af900a20d Sandeep Nair        2014-02-28  1861  	}
41f93af900a20d Sandeep Nair        2014-02-28  1862  	ret = knav_queue_setup_regions(kdev, regions);
41f93af900a20d Sandeep Nair        2014-02-28  1863  	if (ret)
41f93af900a20d Sandeep Nair        2014-02-28  1864  		goto err;
41f93af900a20d Sandeep Nair        2014-02-28  1865  
41f93af900a20d Sandeep Nair        2014-02-28  1866  	ret = knav_queue_init_queues(kdev);
41f93af900a20d Sandeep Nair        2014-02-28  1867  	if (ret < 0) {
41f93af900a20d Sandeep Nair        2014-02-28  1868  		dev_err(dev, "hwqueue initialization failed\n");
41f93af900a20d Sandeep Nair        2014-02-28  1869  		goto err;
41f93af900a20d Sandeep Nair        2014-02-28  1870  	}
41f93af900a20d Sandeep Nair        2014-02-28  1871  
41f93af900a20d Sandeep Nair        2014-02-28  1872  	debugfs_create_file("qmss", S_IFREG | S_IRUGO, NULL, NULL,
74e0e43a09cea3 Qinglang Miao       2020-09-20  1873  			    &knav_queue_debug_fops);
a2dd6877b43ef1 Murali Karicheri    2018-04-17  1874  	device_ready = true;
41f93af900a20d Sandeep Nair        2014-02-28  1875  	return 0;
41f93af900a20d Sandeep Nair        2014-02-28  1876  
41f93af900a20d Sandeep Nair        2014-02-28  1877  err:
41f93af900a20d Sandeep Nair        2014-02-28  1878  	knav_queue_stop_pdsps(kdev);
41f93af900a20d Sandeep Nair        2014-02-28  1879  	knav_queue_free_regions(kdev);
41f93af900a20d Sandeep Nair        2014-02-28  1880  	knav_free_queue_ranges(kdev);
41f93af900a20d Sandeep Nair        2014-02-28  1881  	pm_runtime_put_sync(&pdev->dev);
41f93af900a20d Sandeep Nair        2014-02-28  1882  	pm_runtime_disable(&pdev->dev);
41f93af900a20d Sandeep Nair        2014-02-28  1883  	return ret;
41f93af900a20d Sandeep Nair        2014-02-28  1884  }
41f93af900a20d Sandeep Nair        2014-02-28  1885  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/3] soc: ti: knav_qmss_queue: do device_node auto cleanup
  2024-05-11 10:12 ` [PATCH 2/3] soc: ti: knav_qmss_queue: do device_node auto cleanup kernel test robot
@ 2024-05-12 10:26   ` Kousik Sanagavarapu
  2024-05-12 10:36     ` Julia Lawall
  2024-05-13  6:44     ` Nathan Chancellor
  0 siblings, 2 replies; 6+ messages in thread
From: Kousik Sanagavarapu @ 2024-05-12 10:26 UTC (permalink / raw)
  To: kernel test robot
  Cc: Nishanth Menon, Santosh Shilimkar, Julia Lawall, llvm,
	oe-kbuild-all, Shuah Khan, Javier Carrasco, linux-kernel,
	linux-arm-kernel

On Sat, May 11, 2024 at 06:12:39PM +0800, kernel test robot wrote:
> Hi Kousik,
> 
> kernel test robot noticed the following build errors:
> 

[...]

> All errors (new ones prefixed by >>):
> 
> >> drivers/soc/ti/knav_qmss_queue.c:1853:3: error: cannot jump from this goto statement to its label
>                    goto err;
>                    ^
>    drivers/soc/ti/knav_qmss_queue.c:1855:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
>            struct device_node *regions __free(device_node) =
>                                ^
>    drivers/soc/ti/knav_qmss_queue.c:1840:3: error: cannot jump from this goto statement to its label
>                    goto err;
>                    ^
>    drivers/soc/ti/knav_qmss_queue.c:1855:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
>            struct device_node *regions __free(device_node) =
>                                ^
>    drivers/soc/ti/knav_qmss_queue.c:1835:3: error: cannot jump from this goto statement to its label
>                    goto err;
>                    ^
>    drivers/soc/ti/knav_qmss_queue.c:1855:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
>            struct device_node *regions __free(device_node) =
>                                ^
>    drivers/soc/ti/knav_qmss_queue.c:1831:3: error: cannot jump from this goto statement to its label
>                    goto err;
>                    ^
>    drivers/soc/ti/knav_qmss_queue.c:1855:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
>            struct device_node *regions __free(device_node) =
>                                ^
>    drivers/soc/ti/knav_qmss_queue.c:1822:4: error: cannot jump from this goto statement to its label
>                            goto err;
>                            ^
>    drivers/soc/ti/knav_qmss_queue.c:1855:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
>            struct device_node *regions __free(device_node) =
>                                ^
>    drivers/soc/ti/knav_qmss_queue.c:1826:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
>            struct device_node *queue_pools __free(device_node) =
>                                ^
>    drivers/soc/ti/knav_qmss_queue.c:1818:4: error: cannot jump from this goto statement to its label
>                            goto err;
>                            ^
>    drivers/soc/ti/knav_qmss_queue.c:1855:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
>            struct device_node *regions __free(device_node) =
>                                ^
>    drivers/soc/ti/knav_qmss_queue.c:1826:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
>            struct device_node *queue_pools __free(device_node) =
>                                ^
>    drivers/soc/ti/knav_qmss_queue.c:1810:3: error: cannot jump from this goto statement to its label
>                    goto err;
>                    ^
>    drivers/soc/ti/knav_qmss_queue.c:1855:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
>            struct device_node *regions __free(device_node) =
>                                ^
>    drivers/soc/ti/knav_qmss_queue.c:1826:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
>            struct device_node *queue_pools __free(device_node) =
>                                ^
>    drivers/soc/ti/knav_qmss_queue.c:1813:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
>            struct device_node *pdsps __free(device_node) =
>                                ^
>    drivers/soc/ti/knav_qmss_queue.c:1806:3: error: cannot jump from this goto statement to its label
>                    goto err;
>                    ^
>    drivers/soc/ti/knav_qmss_queue.c:1855:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
>            struct device_node *regions __free(device_node) =
>                                ^
>    drivers/soc/ti/knav_qmss_queue.c:1826:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
>            struct device_node *queue_pools __free(device_node) =
>                                ^
>    drivers/soc/ti/knav_qmss_queue.c:1813:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
>            struct device_node *pdsps __free(device_node) =
>                                ^
>    drivers/soc/ti/knav_qmss_queue.c:1795:3: error: cannot jump from this goto statement to its label
>                    goto err;
>                    ^
>    drivers/soc/ti/knav_qmss_queue.c:1855:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
>            struct device_node *regions __free(device_node) =
>                                ^
>    drivers/soc/ti/knav_qmss_queue.c:1826:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
>            struct device_node *queue_pools __free(device_node) =
>                                ^
>    drivers/soc/ti/knav_qmss_queue.c:1813:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
>            struct device_node *pdsps __free(device_node) =
>                                ^
>    drivers/soc/ti/knav_qmss_queue.c:1801:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
>            struct device_node *qmgrs __free(device_node) =
>                                ^
>    9 errors generated.

Seems like gcc didn't catch this when I compiled locally.

Normally, this would be fixed if we placed braces around the individual
initialization blocks, that is, say

	{
		struct device_node *qmgrs __free(device_node) =
			of_get_child_by_name(node, "qmgrs");
		...
	}


That would make the code look a lot more dirty though and is purely
unnecessary.  So I'd say I'd drop this patch and do a v2 with the
remaining two patches.  Thoughts?

There's also some stuff with classes but that too is not really worth
doing because the code will end up looking very ugly.

Thanks

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/3] soc: ti: knav_qmss_queue: do device_node auto cleanup
  2024-05-12 10:26   ` Kousik Sanagavarapu
@ 2024-05-12 10:36     ` Julia Lawall
  2024-05-13  6:44     ` Nathan Chancellor
  1 sibling, 0 replies; 6+ messages in thread
From: Julia Lawall @ 2024-05-12 10:36 UTC (permalink / raw)
  To: Kousik Sanagavarapu
  Cc: kernel test robot, Nishanth Menon, Santosh Shilimkar,
	Julia Lawall, llvm, oe-kbuild-all, Shuah Khan, Javier Carrasco,
	linux-kernel, linux-arm-kernel



On Sun, 12 May 2024, Kousik Sanagavarapu wrote:

> On Sat, May 11, 2024 at 06:12:39PM +0800, kernel test robot wrote:
> > Hi Kousik,
> >
> > kernel test robot noticed the following build errors:
> >
>
> [...]
>
> > All errors (new ones prefixed by >>):
> >
> > >> drivers/soc/ti/knav_qmss_queue.c:1853:3: error: cannot jump from this goto statement to its label
> >                    goto err;
> >                    ^
> >    drivers/soc/ti/knav_qmss_queue.c:1855:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
> >            struct device_node *regions __free(device_node) =
> >                                ^
> >    drivers/soc/ti/knav_qmss_queue.c:1840:3: error: cannot jump from this goto statement to its label
> >                    goto err;
> >                    ^
> >    drivers/soc/ti/knav_qmss_queue.c:1855:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
> >            struct device_node *regions __free(device_node) =
> >                                ^
> >    drivers/soc/ti/knav_qmss_queue.c:1835:3: error: cannot jump from this goto statement to its label
> >                    goto err;
> >                    ^
> >    drivers/soc/ti/knav_qmss_queue.c:1855:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
> >            struct device_node *regions __free(device_node) =
> >                                ^
> >    drivers/soc/ti/knav_qmss_queue.c:1831:3: error: cannot jump from this goto statement to its label
> >                    goto err;
> >                    ^
> >    drivers/soc/ti/knav_qmss_queue.c:1855:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
> >            struct device_node *regions __free(device_node) =
> >                                ^
> >    drivers/soc/ti/knav_qmss_queue.c:1822:4: error: cannot jump from this goto statement to its label
> >                            goto err;
> >                            ^
> >    drivers/soc/ti/knav_qmss_queue.c:1855:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
> >            struct device_node *regions __free(device_node) =
> >                                ^
> >    drivers/soc/ti/knav_qmss_queue.c:1826:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
> >            struct device_node *queue_pools __free(device_node) =
> >                                ^
> >    drivers/soc/ti/knav_qmss_queue.c:1818:4: error: cannot jump from this goto statement to its label
> >                            goto err;
> >                            ^
> >    drivers/soc/ti/knav_qmss_queue.c:1855:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
> >            struct device_node *regions __free(device_node) =
> >                                ^
> >    drivers/soc/ti/knav_qmss_queue.c:1826:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
> >            struct device_node *queue_pools __free(device_node) =
> >                                ^
> >    drivers/soc/ti/knav_qmss_queue.c:1810:3: error: cannot jump from this goto statement to its label
> >                    goto err;
> >                    ^
> >    drivers/soc/ti/knav_qmss_queue.c:1855:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
> >            struct device_node *regions __free(device_node) =
> >                                ^
> >    drivers/soc/ti/knav_qmss_queue.c:1826:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
> >            struct device_node *queue_pools __free(device_node) =
> >                                ^
> >    drivers/soc/ti/knav_qmss_queue.c:1813:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
> >            struct device_node *pdsps __free(device_node) =
> >                                ^
> >    drivers/soc/ti/knav_qmss_queue.c:1806:3: error: cannot jump from this goto statement to its label
> >                    goto err;
> >                    ^
> >    drivers/soc/ti/knav_qmss_queue.c:1855:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
> >            struct device_node *regions __free(device_node) =
> >                                ^
> >    drivers/soc/ti/knav_qmss_queue.c:1826:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
> >            struct device_node *queue_pools __free(device_node) =
> >                                ^
> >    drivers/soc/ti/knav_qmss_queue.c:1813:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
> >            struct device_node *pdsps __free(device_node) =
> >                                ^
> >    drivers/soc/ti/knav_qmss_queue.c:1795:3: error: cannot jump from this goto statement to its label
> >                    goto err;
> >                    ^
> >    drivers/soc/ti/knav_qmss_queue.c:1855:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
> >            struct device_node *regions __free(device_node) =
> >                                ^
> >    drivers/soc/ti/knav_qmss_queue.c:1826:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
> >            struct device_node *queue_pools __free(device_node) =
> >                                ^
> >    drivers/soc/ti/knav_qmss_queue.c:1813:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
> >            struct device_node *pdsps __free(device_node) =
> >                                ^
> >    drivers/soc/ti/knav_qmss_queue.c:1801:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
> >            struct device_node *qmgrs __free(device_node) =
> >                                ^
> >    9 errors generated.
>
> Seems like gcc didn't catch this when I compiled locally.
>
> Normally, this would be fixed if we placed braces around the individual
> initialization blocks, that is, say
>
> 	{
> 		struct device_node *qmgrs __free(device_node) =
> 			of_get_child_by_name(node, "qmgrs");
> 		...
> 	}
>
>
> That would make the code look a lot more dirty though and is purely
> unnecessary.  So I'd say I'd drop this patch and do a v2 with the
> remaining two patches.  Thoughts?
>
> There's also some stuff with classes but that too is not really worth
> doing because the code will end up looking very ugly.

Please include the patch in such a message so that one can see everything
at once.  I'm not sure it's necessary to show all the error messages
either.  Just a few that help illustrate the problem.

julia

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/3] soc: ti: knav_qmss_queue: do device_node auto cleanup
  2024-05-12 10:26   ` Kousik Sanagavarapu
  2024-05-12 10:36     ` Julia Lawall
@ 2024-05-13  6:44     ` Nathan Chancellor
  2024-05-13  7:23       ` Kousik Sanagavarapu
  1 sibling, 1 reply; 6+ messages in thread
From: Nathan Chancellor @ 2024-05-13  6:44 UTC (permalink / raw)
  To: Kousik Sanagavarapu
  Cc: kernel test robot, Nishanth Menon, Santosh Shilimkar,
	Julia Lawall, llvm, oe-kbuild-all, Shuah Khan, Javier Carrasco,
	linux-kernel, linux-arm-kernel

On Sun, May 12, 2024 at 03:56:22PM +0530, Kousik Sanagavarapu wrote:
> On Sat, May 11, 2024 at 06:12:39PM +0800, kernel test robot wrote:
> > Hi Kousik,
> > 
> > kernel test robot noticed the following build errors:
> > 
> 
> [...]
> 
> > All errors (new ones prefixed by >>):
> > 
> > >> drivers/soc/ti/knav_qmss_queue.c:1853:3: error: cannot jump from this goto statement to its label
> >                    goto err;
> >                    ^
> >    drivers/soc/ti/knav_qmss_queue.c:1855:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
> >            struct device_node *regions __free(device_node) =
> >                                ^
> >    drivers/soc/ti/knav_qmss_queue.c:1840:3: error: cannot jump from this goto statement to its label
> >                    goto err;
> >                    ^
> >    drivers/soc/ti/knav_qmss_queue.c:1855:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
> >            struct device_node *regions __free(device_node) =
> >                                ^
> >    drivers/soc/ti/knav_qmss_queue.c:1835:3: error: cannot jump from this goto statement to its label
> >                    goto err;
> >                    ^
> >    drivers/soc/ti/knav_qmss_queue.c:1855:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
> >            struct device_node *regions __free(device_node) =
> >                                ^
> >    drivers/soc/ti/knav_qmss_queue.c:1831:3: error: cannot jump from this goto statement to its label
> >                    goto err;
> >                    ^
> >    drivers/soc/ti/knav_qmss_queue.c:1855:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
> >            struct device_node *regions __free(device_node) =
> >                                ^
> >    drivers/soc/ti/knav_qmss_queue.c:1822:4: error: cannot jump from this goto statement to its label
> >                            goto err;
> >                            ^
> >    drivers/soc/ti/knav_qmss_queue.c:1855:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
> >            struct device_node *regions __free(device_node) =
> >                                ^
> >    drivers/soc/ti/knav_qmss_queue.c:1826:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
> >            struct device_node *queue_pools __free(device_node) =
> >                                ^
> >    drivers/soc/ti/knav_qmss_queue.c:1818:4: error: cannot jump from this goto statement to its label
> >                            goto err;
> >                            ^
> >    drivers/soc/ti/knav_qmss_queue.c:1855:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
> >            struct device_node *regions __free(device_node) =
> >                                ^
> >    drivers/soc/ti/knav_qmss_queue.c:1826:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
> >            struct device_node *queue_pools __free(device_node) =
> >                                ^
> >    drivers/soc/ti/knav_qmss_queue.c:1810:3: error: cannot jump from this goto statement to its label
> >                    goto err;
> >                    ^
> >    drivers/soc/ti/knav_qmss_queue.c:1855:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
> >            struct device_node *regions __free(device_node) =
> >                                ^
> >    drivers/soc/ti/knav_qmss_queue.c:1826:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
> >            struct device_node *queue_pools __free(device_node) =
> >                                ^
> >    drivers/soc/ti/knav_qmss_queue.c:1813:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
> >            struct device_node *pdsps __free(device_node) =
> >                                ^
> >    drivers/soc/ti/knav_qmss_queue.c:1806:3: error: cannot jump from this goto statement to its label
> >                    goto err;
> >                    ^
> >    drivers/soc/ti/knav_qmss_queue.c:1855:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
> >            struct device_node *regions __free(device_node) =
> >                                ^
> >    drivers/soc/ti/knav_qmss_queue.c:1826:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
> >            struct device_node *queue_pools __free(device_node) =
> >                                ^
> >    drivers/soc/ti/knav_qmss_queue.c:1813:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
> >            struct device_node *pdsps __free(device_node) =
> >                                ^
> >    drivers/soc/ti/knav_qmss_queue.c:1795:3: error: cannot jump from this goto statement to its label
> >                    goto err;
> >                    ^
> >    drivers/soc/ti/knav_qmss_queue.c:1855:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
> >            struct device_node *regions __free(device_node) =
> >                                ^
> >    drivers/soc/ti/knav_qmss_queue.c:1826:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
> >            struct device_node *queue_pools __free(device_node) =
> >                                ^
> >    drivers/soc/ti/knav_qmss_queue.c:1813:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
> >            struct device_node *pdsps __free(device_node) =
> >                                ^
> >    drivers/soc/ti/knav_qmss_queue.c:1801:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
> >            struct device_node *qmgrs __free(device_node) =
> >                                ^
> >    9 errors generated.
> 
> Seems like gcc didn't catch this when I compiled locally.

FWIW, you may notice this as you do more conversions. The fact that GCC
does not warn at all is a GCC bug as far as I am aware (i.e., clang's
error is correct):

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91951

which has come up in other places:

https://lore.kernel.org/20240425174732.GA270911@dev-arch.thelio-3990X/

Cheers,
Nathan

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/3] soc: ti: knav_qmss_queue: do device_node auto cleanup
  2024-05-13  6:44     ` Nathan Chancellor
@ 2024-05-13  7:23       ` Kousik Sanagavarapu
  2024-05-16 14:48         ` Jonathan Cameron
  0 siblings, 1 reply; 6+ messages in thread
From: Kousik Sanagavarapu @ 2024-05-13  7:23 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: kernel test robot, Nishanth Menon, Santosh Shilimkar,
	Julia Lawall, llvm, oe-kbuild-all, Shuah Khan, Javier Carrasco,
	linux-kernel, linux-arm-kernel

On Sun, May 12, 2024 at 11:44:51PM -0700, Nathan Chancellor wrote:
> On Sun, May 12, 2024 at 03:56:22PM +0530, Kousik Sanagavarapu wrote:
> > On Sat, May 11, 2024 at 06:12:39PM +0800, kernel test robot wrote:
> > > Hi Kousik,
> > > 
> > > kernel test robot noticed the following build errors:
> > > 
> > 
> > [...]
> > 
> > > All errors (new ones prefixed by >>):
> > > 
> > > >> drivers/soc/ti/knav_qmss_queue.c:1853:3: error: cannot jump from this goto statement to its label
> > >                    goto err;
> > >                    ^
> > >    drivers/soc/ti/knav_qmss_queue.c:1855:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
> > >            struct device_node *regions __free(device_node) =
> > >                                ^

[...]

> > Seems like gcc didn't catch this when I compiled locally.
> 
> FWIW, you may notice this as you do more conversions. The fact that GCC
> does not warn at all is a GCC bug as far as I am aware (i.e., clang's
> error is correct):
> 
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91951
> 
> which has come up in other places:
> 
> https://lore.kernel.org/20240425174732.GA270911@dev-arch.thelio-3990X/

Thank you so much for these links :)

All my internet searches ended up at stackoverflow posts which didn't
even describe the problem correctly, which also lead me to write an
email explaining a partly erroneous solution, which is sitting in my
mailbox ;)

Thanks again, these will help a lot.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/3] soc: ti: knav_qmss_queue: do device_node auto cleanup
  2024-05-13  7:23       ` Kousik Sanagavarapu
@ 2024-05-16 14:48         ` Jonathan Cameron
  0 siblings, 0 replies; 6+ messages in thread
From: Jonathan Cameron @ 2024-05-16 14:48 UTC (permalink / raw)
  To: Kousik Sanagavarapu
  Cc: Nathan Chancellor, kernel test robot, Nishanth Menon,
	Santosh Shilimkar, Julia Lawall, llvm, oe-kbuild-all, Shuah Khan,
	Javier Carrasco, linux-kernel, linux-arm-kernel

On Mon, 13 May 2024 12:53:27 +0530
Kousik Sanagavarapu <five231003@gmail.com> wrote:

> On Sun, May 12, 2024 at 11:44:51PM -0700, Nathan Chancellor wrote:
> > On Sun, May 12, 2024 at 03:56:22PM +0530, Kousik Sanagavarapu wrote:  
> > > On Sat, May 11, 2024 at 06:12:39PM +0800, kernel test robot wrote:  
> > > > Hi Kousik,
> > > > 
> > > > kernel test robot noticed the following build errors:
> > > >   
> > > 
> > > [...]
> > >   
> > > > All errors (new ones prefixed by >>):
> > > >   
> > > > >> drivers/soc/ti/knav_qmss_queue.c:1853:3: error: cannot jump from this goto statement to its label  
> > > >                    goto err;
> > > >                    ^
> > > >    drivers/soc/ti/knav_qmss_queue.c:1855:22: note: jump bypasses initialization of variable with __attribute__((cleanup))
> > > >            struct device_node *regions __free(device_node) =
> > > >                                ^  
> 
> [...]
> 
> > > Seems like gcc didn't catch this when I compiled locally.  
> > 
> > FWIW, you may notice this as you do more conversions. The fact that GCC
> > does not warn at all is a GCC bug as far as I am aware (i.e., clang's
> > error is correct):
> > 
> > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91951
> > 
> > which has come up in other places:
> > 
> > https://lore.kernel.org/20240425174732.GA270911@dev-arch.thelio-3990X/  
> 
> Thank you so much for these links :)
> 
> All my internet searches ended up at stackoverflow posts which didn't
> even describe the problem correctly, which also lead me to write an
> email explaining a partly erroneous solution, which is sitting in my
> mailbox ;)
> 
> Thanks again, these will help a lot.

Independent of all this, it's not a good idea form a readability point
of view to mix automated and manual cleanup.  So in cases like this
where you want to do scope based cleanup, use separate functions
that have appropriately defined scope (or brackets for the really minor
cases).

Here, you may just be able to push the device_node get into
knav_queue_setup_regions() for example.

Jonathan

> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-05-16 14:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20240510071432.62913-3-five231003@gmail.com>
2024-05-11 10:12 ` [PATCH 2/3] soc: ti: knav_qmss_queue: do device_node auto cleanup kernel test robot
2024-05-12 10:26   ` Kousik Sanagavarapu
2024-05-12 10:36     ` Julia Lawall
2024-05-13  6:44     ` Nathan Chancellor
2024-05-13  7:23       ` Kousik Sanagavarapu
2024-05-16 14:48         ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox