Skip to contentSkip to conversation

drivers/clk/rockchip/clk-rk3576.c:1752:22: error: implicit declaration of function 'kzalloc'

PATCH kernel test robot 1 participant 1 message May 15, 2025

lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   bdd609656ff5573db9ba1d26496a528bdd297cf2
commit: 70a114daf2077472e58b3cac23ba8998e35352f4 [7657/11093] clk: rockchip: introduce auxiliary GRFs
config: arm-allmodconfig (https://download.01.org/0day-ci/archive/20250515/[email protected]/config)
compiler: arm-linux-gnueabi-gcc (GCC) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250515/[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/rockchip/clk-rk3576.c: In function 'rk3576_clk_init':

>> drivers/clk/rockchip/clk-rk3576.c:1752:22: error: implicit declaration of function 'kzalloc' [-Wimplicit-function-declaration]
    1752 |         pmu0_grf_e = kzalloc(sizeof(*pmu0_grf_e), GFP_KERNEL);
         |                      ^~~~~~~
>> drivers/clk/rockchip/clk-rk3576.c:1752:20: error: assignment to 'struct rockchip_aux_grf *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
    1752 |         pmu0_grf_e = kzalloc(sizeof(*pmu0_grf_e), GFP_KERNEL);
         |                    ^

vim +/kzalloc +1752 drivers/clk/rockchip/clk-rk3576.c

1722
1723 static void __init rk3576_clk_init(struct device_node *np)
1724 {
1725 struct rockchip_clk_provider *ctx;
1726 unsigned long clk_nr_clks;
1727 void __iomem *reg_base;
1728 struct rockchip_aux_grf *pmu0_grf_e;
1729 struct regmap *pmu0_grf;
1730
1731 clk_nr_clks = rockchip_clk_find_max_clk_id(rk3576_clk_branches,
1732 ARRAY_SIZE(rk3576_clk_branches)) + 1;
1733
1734 pmu0_grf = syscon_regmap_lookup_by_compatible("rockchip,rk3576-pmu0-grf");
1735 if (IS_ERR(pmu0_grf)) {
1736 pr_err("%s: could not get PMU0 GRF syscon\n", __func__);
1737 return;
1738 }
1739
1740 reg_base = of_iomap(np, 0);
1741 if (!reg_base) {
1742 pr_err("%s: could not map cru region\n", __func__);
1743 return;
1744 }
1745
1746 ctx = rockchip_clk_init(np, reg_base, clk_nr_clks);
1747 if (IS_ERR(ctx)) {
1748 pr_err("%s: rockchip clk init failed\n", __func__);
1749 goto err_unmap;
1750 }
1751

> 1752		pmu0_grf_e = kzalloc(sizeof(*pmu0_grf_e), GFP_KERNEL);

1753 if (!pmu0_grf_e)
1754 goto err_unmap;
1755
1756 pmu0_grf_e->grf = pmu0_grf;
1757 pmu0_grf_e->type = grf_type_pmu0;
1758 hash_add(ctx->aux_grf_table, &pmu0_grf_e->node, grf_type_pmu0);
1759
1760 rockchip_clk_register_plls(ctx, rk3576_pll_clks,
1761 ARRAY_SIZE(rk3576_pll_clks),
1762 RK3576_GRF_SOC_STATUS0);
1763
1764 rockchip_clk_register_armclk(ctx, ARMCLK_L, "armclk_l",
1765 mux_armclkl_p, ARRAY_SIZE(mux_armclkl_p),
1766 &rk3576_cpulclk_data, rk3576_cpulclk_rates,
1767 ARRAY_SIZE(rk3576_cpulclk_rates));
1768 rockchip_clk_register_armclk(ctx, ARMCLK_B, "armclk_b",
1769 mux_armclkb_p, ARRAY_SIZE(mux_armclkb_p),
1770 &rk3576_cpubclk_data, rk3576_cpubclk_rates,
1771 ARRAY_SIZE(rk3576_cpubclk_rates));
1772
1773 rockchip_clk_register_branches(ctx, rk3576_clk_branches,
1774 ARRAY_SIZE(rk3576_clk_branches));
1775
1776 rk3576_rst_init(np, reg_base);
1777
1778 rockchip_register_restart_notifier(ctx, RK3576_GLB_SRST_FST, NULL);
1779
1780 rockchip_clk_of_add_provider(np, ctx);
1781
1782 return;
1783
1784 err_unmap:
1785 iounmap(reg_base);
1786 return;
1787 }
1788

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki