* [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
@ 2026-03-17 16:51 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-03-17 16:51 UTC (permalink / raw)
To: cros-kernel-buildreports; +Cc: oe-kbuild-all
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-03-17 16:51 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-17 16:51 [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 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.