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 30/30] drivers/cma_test/cma_alloc_test_drv.c:122:8: warning: GCC does not allow variable declarations in for loop initializers before C99
Date: Wed, 18 Mar 2026 00:51:15 +0800 [thread overview]
Message-ID: <202603180018.Af9ORmD0-lkp@intel.com> (raw)
Hi Juan,
FYI, the error/warning still remains.
tree: https://android.googlesource.com/kernel/common main-16k-gs-shusky-5.15
head: 339bea17e1ccb695cddcbc39f88955c85e45d97a
commit: 43b8bd1b3be373d3fd2e20886db6cb08d4081ad5 [30/30] ANDROID: cma: Allocate CMA memory at probing time
config: x86_64-buildonly-randconfig-003-20260317 (https://download.01.org/0day-ci/archive/20260318/202603180018.Af9ORmD0-lkp@intel.com/config)
compiler: clang version 23.0.0git (https://github.com/llvm/llvm-project 4abb927bacf37f18f6359a41639a6d1b3bffffb5)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260318/202603180018.Af9ORmD0-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/202603180018.Af9ORmD0-lkp@intel.com/
All warnings (new ones prefixed by >>):
In file included from <built-in>:3:
In file included from include/linux/compiler_types.h:80:
include/linux/compiler-clang.h:24:9: warning: '__SANITIZE_ADDRESS__' macro redefined [-Wmacro-redefined]
24 | #define __SANITIZE_ADDRESS__
| ^
<built-in>:354:9: note: previous definition is here
354 | #define __SANITIZE_ADDRESS__ 1
| ^
drivers/cma_test/cma_alloc_test_drv.c:104:24: error: no member named 'cma_area' in 'struct device'
104 | if (ret || !pdev->dev.cma_area) {
| ~~~~~~~~~ ^
drivers/cma_test/cma_alloc_test_drv.c:117:22: error: no member named 'cma_area' in 'struct device'
117 | cma_ptr = pdev->dev.cma_area;
| ~~~~~~~~~ ^
>> drivers/cma_test/cma_alloc_test_drv.c:122:8: warning: GCC does not allow variable declarations in for loop initializers before C99 [-Wgcc-compat]
122 | for (int i = 0; i < nr_pages; i++) {
| ^
drivers/cma_test/cma_alloc_test_drv.c:167:12: error: incompatible function pointer types initializing 'int (*)(struct platform_device *)' with an expression of type 'void (struct platform_device *)' [-Wincompatible-function-pointer-types]
167 | .remove = cma_test_remove,
| ^~~~~~~~~~~~~~~
2 warnings and 3 errors generated.
vim +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:[~2026-03-17 16:51 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=202603180018.Af9ORmD0-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.