mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] clk: renesas: r9a09g077: Add missing slab.h and cleanup.h includes
@ 2026-09-13 17:30 Sasha Levin
  2026-09-14  7:38 ` Geert Uytterhoeven
  0 siblings, 1 reply; 2+ messages in thread
From: Sasha Levin @ 2026-09-13 17:30 UTC (permalink / raw)
  To: Geert Uytterhoeven, Stephen Boyd, Brian Masney, Jerome Brunet,
	Lad Prabhakar
  Cc: Sasha Levin, kernel test robot, linux-renesas-soc, linux-clk,
	linux-kernel

r9a09g077_post_init() uses kzalloc_obj() and __free(kfree), but the file
includes neither <linux/slab.h> nor <linux/cleanup.h>. It only builds
where those happen to be pulled in transitively; on arm allmodconfig
they are not, and the build fails:

  drivers/clk/renesas/r9a09g077-cpg.c:966:35: error: use of undeclared
  identifier '__free_kfree'; did you mean '__free_pages'?
  drivers/clk/renesas/r9a09g077-cpg.c:966:35: error: 'cleanup' function
  '__free_pages' must take 1 parameter
  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]
  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]

gcc reports the same thing as "cleanup argument not a function" plus an
implicit declaration of kzalloc_obj().

Include both headers explicitly rather than relying on an incidental
include chain.

Fixes: 810b8b6c4e02 ("clk: renesas: r9a09g077: Register SYSC regmap")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202609101334.xgbNoC4e-lkp@intel.com/
Assisted-by: LLM
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/clk/renesas/r9a09g077-cpg.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/clk/renesas/r9a09g077-cpg.c b/drivers/clk/renesas/r9a09g077-cpg.c
index 0495e3206973c..5a0e7df1eb06c 100644
--- a/drivers/clk/renesas/r9a09g077-cpg.c
+++ b/drivers/clk/renesas/r9a09g077-cpg.c
@@ -8,6 +8,7 @@
 
 #include <linux/bitfield.h>
 #include <linux/bits.h>
+#include <linux/cleanup.h>
 #include <linux/clk-provider.h>
 #include <linux/clk/renesas.h>
 #include <linux/device.h>
@@ -20,6 +21,7 @@
 #include <linux/module.h>
 #include <linux/of_address.h>
 #include <linux/regmap.h>
+#include <linux/slab.h>
 #include <linux/types.h>
 #include <linux/units.h>
 
-- 
2.53.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] clk: renesas: r9a09g077: Add missing slab.h and cleanup.h includes
  2026-09-13 17:30 [PATCH] clk: renesas: r9a09g077: Add missing slab.h and cleanup.h includes Sasha Levin
@ 2026-09-14  7:38 ` Geert Uytterhoeven
  0 siblings, 0 replies; 2+ messages in thread
From: Geert Uytterhoeven @ 2026-09-14  7:38 UTC (permalink / raw)
  To: Sasha Levin
  Cc: Stephen Boyd, Brian Masney, Jerome Brunet, Lad Prabhakar,
	kernel test robot, linux-renesas-soc, linux-clk, linux-kernel

Hi Sasha,

On Sun, 13 Sept 2026 at 19:30, Sasha Levin <sashal@kernel.org> wrote:
> r9a09g077_post_init() uses kzalloc_obj() and __free(kfree), but the file
> includes neither <linux/slab.h> nor <linux/cleanup.h>. It only builds
> where those happen to be pulled in transitively; on arm allmodconfig
> they are not, and the build fails:
>
>   drivers/clk/renesas/r9a09g077-cpg.c:966:35: error: use of undeclared
>   identifier '__free_kfree'; did you mean '__free_pages'?
>   drivers/clk/renesas/r9a09g077-cpg.c:966:35: error: 'cleanup' function
>   '__free_pages' must take 1 parameter
>   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]
>   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]
>
> gcc reports the same thing as "cleanup argument not a function" plus an
> implicit declaration of kzalloc_obj().
>
> Include both headers explicitly rather than relying on an incidental
> include chain.
>
> Fixes: 810b8b6c4e02 ("clk: renesas: r9a09g077: Register SYSC regmap")
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202609101334.xgbNoC4e-lkp@intel.com/

See my reply to that message:
https://lore.kernel.org/oe-kbuild-all/CAMuHMdVBFCKA5gjQeXuTrOYbaY_sZg-Gnz-fgOCSKhF3cV8jhg@mail.gmail.com/

> Assisted-by: LLM

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-09-14  7:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-13 17:30 [PATCH] clk: renesas: r9a09g077: Add missing slab.h and cleanup.h includes Sasha Levin
2026-09-14  7:38 ` Geert Uytterhoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®