All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: cros-kernel-buildreports@googlegroups.com
Cc: oe-kbuild-all@lists.linux.dev
Subject: [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
Date: Thu, 3 Apr 2025 08:32:52 +0800	[thread overview]
Message-ID: <202504030800.EtHpXF4e-lkp@intel.com> (raw)

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

                 reply	other threads:[~2025-04-03  0:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202504030800.EtHpXF4e-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=cros-kernel-buildreports@googlegroups.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.