drivers/clk/renesas/r9a09g077-cpg.c:966:35: error: use of undeclared identifier '__free_kfree'; did you mean '__free_pages'?
kernel test robot
build bottree: https://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers.git renesas-clk-for-v7.4 head: 810b8b6c4e02c40991c29491cec09ebdaf5ec6d0 commit: 810b8b6c4e02c40991c29491cec09ebdaf5ec6d0 [16/16] clk: renesas: r9a09g077: Register SYSC regmap config: hexagon-allmodconfig (https://download.01.org/0day-ci/archive/20260910/[email protected]/config) compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project c1872e7fd3307679a2da53f9d83de0ccf234b4ad) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260910/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All errors (new ones prefixed by >>):
>> drivers/clk/renesas/r9a09g077-cpg.c:966:35: error: use of undeclared identifier '__free_kfree'; did you mean '__free_pages'?
966 | struct regmap_config *regmap_cfg __free(kfree) = kzalloc_obj(*regmap_cfg);
| ^~~~~~~~~~~~~
include/linux/cleanup.h:213:33: note: expanded from macro '__free'
213 | #define __free(_name) __cleanup(__free_##_name)
| ^~~~~~~~~~~~~~
<scratch space>:3:1: note: expanded from here
3 | __free_kfree
| ^~~~~~~~~~~~
include/linux/gfp.h:342:13: note: '__free_pages' declared here
342 | extern void __free_pages(struct page *page, unsigned int order);
| ^
>> drivers/clk/renesas/r9a09g077-cpg.c:966:35: error: 'cleanup' function '__free_pages' must take 1 parameter
966 | struct regmap_config *regmap_cfg __free(kfree) = kzalloc_obj(*regmap_cfg);
| ^
include/linux/cleanup.h:213:33: note: expanded from macro '__free'
213 | #define __free(_name) __cleanup(__free_##_name)
| ^
<scratch space>:3:1: note: expanded from here
3 | __free_kfree
| ^
>> drivers/clk/renesas/r9a09g077-cpg.c:966:51: error: call to undeclared function 'kzalloc_obj'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
966 | struct regmap_config *regmap_cfg __free(kfree) = kzalloc_obj(*regmap_cfg);
| ^
>> drivers/clk/renesas/r9a09g077-cpg.c:966:24: error: incompatible integer to pointer conversion initializing 'struct regmap_config *' with an expression of type 'int' [-Wint-conversion]
966 | struct regmap_config *regmap_cfg __free(kfree) = kzalloc_obj(*regmap_cfg);
| ^ ~~~~~~~~~~~~~~~~~~~~~~~~4 errors generated.
vim +966 drivers/clk/renesas/r9a09g077-cpg.c
963
964 static int r9a09g077_post_init(struct device *dev, struct cpg_mssr_pub *pub)
965 {
> 966 struct regmap_config *regmap_cfg __free(kfree) = kzalloc_obj(*regmap_cfg);
967 struct r9a09g077_sysc_reg *sysc_reg;
968 struct regmap *regmap;
969 struct resource res;
970 int ret;
971
972 /*
973 * Return early if the SYSC sizes are not as expected, for backwards
974 * compatibility with older device trees that only expose the 64 KiB
975 * CPG register window.
976 */
977 ret = of_address_to_resource(dev->of_node, 0, &res);
978 if (ret)
979 return ret;
980 if (resource_size(&res) != RZT2H_CPG_REG_SIZE)
981 return 0;
982
983 ret = of_address_to_resource(dev->of_node, 1, &res);
984 if (ret)
985 return ret;
986 if (resource_size(&res) != RZT2H_CPG_REG_SIZE)
987 return 0;
988
989 if (!regmap_cfg)
990 return -ENOMEM;
991
992 sysc_reg = devm_kzalloc(dev, sizeof(*sysc_reg), GFP_KERNEL);
993 if (!sysc_reg)
994 return -ENOMEM;
995
996 /* Only allow access in the SYSC regions */
997 sysc_reg->base[0] = pub->base0 + RZT2H_SYSC_OFFSET;
998 sysc_reg->base[1] = pub->base1 + RZT2H_SYSC_OFFSET;
999
1000 regmap_cfg->name = "rzt2h_sysc";
1001 regmap_cfg->reg_bits = 32;
1002 regmap_cfg->reg_stride = 4;
1003 regmap_cfg->val_bits = 32;
1004 regmap_cfg->fast_io = true;
1005 regmap_cfg->max_register = RZT2H_SYSC_SIZE - 1;
1006 regmap_cfg->readable_reg = r9a09g077_writeable_readable_sysc;
1007 regmap_cfg->writeable_reg = r9a09g077_writeable_readable_sysc;
1008
1009 regmap = devm_regmap_init(dev, &r9a09g077_sys_regmap_bus, sysc_reg, regmap_cfg);
1010 if (IS_ERR(regmap))
1011 return PTR_ERR(regmap);
1012
1013 return of_syscon_register_regmap(dev->of_node, regmap);
1014 }
1015
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Hi Kernel Test Robot,
Quoted 35 lines · kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers.git renesas-clk-for-v7.4 head: 810b8b6c4e02c40991c29491cec09ebdaf5ec6d0 commit: 810b8b6c4e02c40991c29491cec09ebdaf5ec6d0 [16/16] clk: renesas: r9a09g077: Register SYSC regmap config: hexagon-allmodconfig (https://download.01.org/0day-ci/archive/20260910/[email protected]/config) compiler: clang version 24.0.0git (https://github.com/llvm/llvm-project c1872e7fd3307679a2da53f9d83de0ccf234b4ad) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260910/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/All errors (new ones prefixed by >>):
Quoted 1 line
Quoted 1 line
drivers/clk/renesas/r9a09g077-cpg.c:966:35: error: use of undeclared identifier '__free_kfree'; did you mean '__free_pages'?966 | struct regmap_config *regmap_cfg __free(kfree) = kzalloc_obj(*regmap_cfg); | ^~~~~~~~~~~~~ include/linux/cleanup.h:213:33: note: expanded from macro '__free' 213 | #define __free(_name) __cleanup(__free_##_name) | ^~~~~~~~~~~~~~ <scratch space>:3:1: note: expanded from here 3 | __free_kfree | ^~~~~~~~~~~~ include/linux/gfp.h:342:13: note: '__free_pages' declared here 342 | extern void __free_pages(struct page *page, unsigned int order); | ^Quoted 1 line
Quoted 1 line
drivers/clk/renesas/r9a09g077-cpg.c:966:35: error: 'cleanup' function '__free_pages' must take 1 parameter966 | struct regmap_config *regmap_cfg __free(kfree) = kzalloc_obj(*regmap_cfg); | ^ include/linux/cleanup.h:213:33: note: expanded from macro '__free' 213 | #define __free(_name) __cleanup(__free_##_name) | ^ <scratch space>:3:1: note: expanded from here 3 | __free_kfree | ^
Quoted 7 lines
Quoted 1 line
Quoted 1 line
drivers/clk/renesas/r9a09g077-cpg.c:966:51: error: call to undeclared function 'kzalloc_obj'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]966 | struct regmap_config *regmap_cfg __free(kfree) = kzalloc_obj(*regmap_cfg); | ^Quoted 1 line
Quoted 1 line
drivers/clk/renesas/r9a09g077-cpg.c:966:24: error: incompatible integer to pointer conversion initializing 'structregmap_config*' with an expression of type 'int' [-Wint-conversion]966 | struct regmap_config *regmap_cfg __free(kfree) = kzalloc_obj(*regmap_cfg); | ^ ~~~~~~~~~~~~~~~~~~~~~~~~4 errors generated.
Thanks, will amend with:
+#include <linux/cleanup.h>
+#include <linux/slab.h>
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds