Re: [PATCH 4/7] clk: en7523: introduce chip_scu regmap

Dan Carpenter
2024-09-02T07:37:19Z

Hi Lorenzo,

kernel test robot noticed the following build warnings:

url: https://github.com/intel-lab-lkp/linux/commits/Lorenzo-Bianconi/dt-bindings-clock-airoha-update-reg-mapping-for-EN7581-SoC/20240831-152135
base: f0e992956eb617c8f16119944bfe101dea074147
patch link: https://lore.kernel.org/r/20240831-clk-en7581-syscon-v1-4-5c2683541068%40kernel.org
patch subject: [PATCH 4/7] clk: en7523: introduce chip_scu regmap
config: nios2-randconfig-r072-20240902 (https://download.01.org/0day-ci/archive/20240902/202409021114.11d1W3PJ-lkp@intel.com/config)
compiler: nios2-linux-gcc (GCC) 14.1.0

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>
| Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
| Closes: https://lore.kernel.org/r/202409021114.11d1W3PJ-lkp@intel.com/

New smatch warnings:
drivers/clk/clk-en7523.c:471 en7581_register_clocks() error: uninitialized symbol 'hw'.
drivers/clk/clk-en7523.c:471 en7581_register_clocks() warn: passing zero to 'PTR_ERR'

Old smatch warnings:
drivers/clk/clk-en7523.c:478 en7581_register_clocks() error: uninitialized symbol 'hw'.
drivers/clk/clk-en7523.c:478 en7581_register_clocks() warn: passing zero to 'PTR_ERR'

vim +/hw +471 drivers/clk/clk-en7523.c

f114fc7e44857f Lorenzo Bianconi 2024-08-31 459 static void en7581_register_clocks(struct device *dev, struct clk_hw_onecell_data *clk_data,
f114fc7e44857f Lorenzo Bianconi 2024-08-31 460 struct regmap *map, void __iomem *base)
f114fc7e44857f Lorenzo Bianconi 2024-08-31 461 {
f114fc7e44857f Lorenzo Bianconi 2024-08-31 462 struct clk_hw *hw;
f114fc7e44857f Lorenzo Bianconi 2024-08-31 463 u32 rate;
f114fc7e44857f Lorenzo Bianconi 2024-08-31 464 int i;
f114fc7e44857f Lorenzo Bianconi 2024-08-31 465
f114fc7e44857f Lorenzo Bianconi 2024-08-31 466 for (i = 0; i < ARRAY_SIZE(en7523_base_clks); i++) {
f114fc7e44857f Lorenzo Bianconi 2024-08-31 467 const struct en_clk_desc *desc = &en7523_base_clks[i];
f114fc7e44857f Lorenzo Bianconi 2024-08-31 468 u32 val, reg = desc->div_reg ? desc->div_reg : desc->base_reg;
f114fc7e44857f Lorenzo Bianconi 2024-08-31 469
f114fc7e44857f Lorenzo Bianconi 2024-08-31 470 if (regmap_read(map, desc->base_reg, &val)) {
f114fc7e44857f Lorenzo Bianconi 2024-08-31 @471 pr_err("Failed reading fixed clk rate %s: %ld\n",
f114fc7e44857f Lorenzo Bianconi 2024-08-31 472 desc->name, PTR_ERR(hw));
^^
Uninitialized

f114fc7e44857f Lorenzo Bianconi 2024-08-31 473 continue;
f114fc7e44857f Lorenzo Bianconi 2024-08-31 474 }
f114fc7e44857f Lorenzo Bianconi 2024-08-31 475 rate = en7523_get_base_rate(desc, val);
f114fc7e44857f Lorenzo Bianconi 2024-08-31 476
f114fc7e44857f Lorenzo Bianconi 2024-08-31 477 if (regmap_read(map, reg, &val)) {
f114fc7e44857f Lorenzo Bianconi 2024-08-31 478 pr_err("Failed reading fixed clk div %s: %ld\n",
f114fc7e44857f Lorenzo Bianconi 2024-08-31 479 desc->name, PTR_ERR(hw));
^^
Uniniitialized

f114fc7e44857f Lorenzo Bianconi 2024-08-31 480 continue;
f114fc7e44857f Lorenzo Bianconi 2024-08-31 481 }
f114fc7e44857f Lorenzo Bianconi 2024-08-31 482 rate /= en7523_get_div(desc, val);
f114fc7e44857f Lorenzo Bianconi 2024-08-31 483
f114fc7e44857f Lorenzo Bianconi 2024-08-31 484 hw = clk_hw_register_fixed_rate(dev, desc->name, NULL, 0, rate);
f114fc7e44857f Lorenzo Bianconi 2024-08-31 485 if (IS_ERR(hw)) {
f114fc7e44857f Lorenzo Bianconi 2024-08-31 486 pr_err("Failed to register clk %s: %ld\n",
f114fc7e44857f Lorenzo Bianconi 2024-08-31 487 desc->name, PTR_ERR(hw));
f114fc7e44857f Lorenzo Bianconi 2024-08-31 488 continue;
f114fc7e44857f Lorenzo Bianconi 2024-08-31 489 }
f114fc7e44857f Lorenzo Bianconi 2024-08-31 490
f114fc7e44857f Lorenzo Bianconi 2024-08-31 491 clk_data->hws[desc->id] = hw;
f114fc7e44857f Lorenzo Bianconi 2024-08-31 492 }
f114fc7e44857f Lorenzo Bianconi 2024-08-31 493
f114fc7e44857f Lorenzo Bianconi 2024-08-31 494 hw = en7523_register_pcie_clk(dev, base);
f114fc7e44857f Lorenzo Bianconi 2024-08-31 495 clk_data->hws[EN7523_CLK_PCIE] = hw;
f114fc7e44857f Lorenzo Bianconi 2024-08-31 496
f114fc7e44857f Lorenzo Bianconi 2024-08-31 497 clk_data->num = EN7523_NUM_CLOCKS;
f114fc7e44857f Lorenzo Bianconi 2024-08-31 498 }

--
0-DAY CI Kernel Test Service