All of lore.kernel.org
 help / color / mirror / Atom feed
* [android-common:main-16k-gs-shusky-5.15 17/17] drivers/cma_test/cma_alloc_test_drv.c:122:3: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
@ 2025-04-03  0:32 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-04-03  0:32 UTC (permalink / raw)
  To: cros-kernel-buildreports; +Cc: oe-kbuild-all

tree:   https://android.googlesource.com/kernel/common main-16k-gs-shusky-5.15
head:   f344ab3d86fe50dc56c87b7a96c07b8210635ec5
commit: 43b8bd1b3be373d3fd2e20886db6cb08d4081ad5 [17/17] ANDROID: cma: Allocate CMA memory at probing time
config: arm-randconfig-002-20250403 (https://download.01.org/0day-ci/archive/20250403/202504030800.EtHpXF4e-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 8.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250403/202504030800.EtHpXF4e-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/202504030800.EtHpXF4e-lkp@intel.com/

All errors (new ones prefixed by >>):

   drivers/cma_test/cma_alloc_test_drv.c: In function 'cma_test_probe':
   drivers/cma_test/cma_alloc_test_drv.c:104:24: error: 'struct device' has no member named 'cma_area'; did you mean 'dma_parms'?
     if (ret || !pdev->dev.cma_area) {
                           ^~~~~~~~
                           dma_parms
   drivers/cma_test/cma_alloc_test_drv.c:117:22: error: 'struct device' has no member named 'cma_area'; did you mean 'dma_parms'?
     cma_ptr = pdev->dev.cma_area;
                         ^~~~~~~~
                         dma_parms
>> drivers/cma_test/cma_alloc_test_drv.c:122:3: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
      for (int i = 0; i < nr_pages; i++) {
      ^~~
   drivers/cma_test/cma_alloc_test_drv.c:122:3: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code
   drivers/cma_test/cma_alloc_test_drv.c: At top level:
   drivers/cma_test/cma_alloc_test_drv.c:167:12: error: initialization of 'int (*)(struct platform_device *)' from incompatible pointer type 'void (*)(struct platform_device *)' [-Werror=incompatible-pointer-types]
     .remove = cma_test_remove,
               ^~~~~~~~~~~~~~~
   drivers/cma_test/cma_alloc_test_drv.c:167:12: note: (near initialization for 'cma_test_driver.remove')
   cc1: some warnings being treated as errors


vim +/for +122 drivers/cma_test/cma_alloc_test_drv.c

    88	
    89	static int cma_test_probe(struct platform_device *pdev)
    90	{
    91		int ret;
    92		const struct of_device_id *of_id;
    93	
    94		pr_info("Probing device");
    95	
    96		buffer = NULL;
    97		of_id = of_match_device(cma_test_dt_ids, &pdev->dev);
    98		if (!of_id) {
    99			pr_info("The node was not found in DTB");
   100			return -ENODEV;
   101		}
   102	
   103		ret = of_reserved_mem_device_init(&pdev->dev);
 > 104		if (ret || !pdev->dev.cma_area) {
   105			dev_err(&pdev->dev,
   106				"The CMA reserved area is not assigned (ret %d)\n",
   107				ret);
   108			return -EINVAL;
   109		}
   110	
   111		ret = devm_add_action(&pdev->dev, rmem_remove_callback, &pdev->dev);
   112		if (ret) {
   113			of_reserved_mem_device_release(&pdev->dev);
   114			return ret;
   115		}
   116	
   117		cma_ptr = pdev->dev.cma_area;
   118		pages = cma_alloc(cma_ptr, nr_pages, get_order(PAGE_SIZE), false);
   119		if (pages) {
   120			pr_info("CMA allocation of %d pages was successful", nr_pages);
   121			buffer = kmap_local_page(pages);
 > 122			for (int i = 0; i < nr_pages; i++) {
   123				// Write one byte of every page.
   124				buffer[i * PAGE_SIZE] = 'A';
   125			}
   126	
   127		}
   128	
   129		return 0;
   130	}
   131	

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

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

only message in thread, other threads:[~2025-04-03  0:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-03  0:32 [android-common:main-16k-gs-shusky-5.15 17/17] drivers/cma_test/cma_alloc_test_drv.c:122:3: error: 'for' loop initial declarations are only allowed in C99 or C11 mode kernel 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.