Re: [PATCH 6/9] clk: realtek: Add support for mux clock
From: Dan Carpenter
Date: Mon Jan 05 2026 - 07:16:14 EST
Hi Yu-Chun,
kernel test robot noticed the following build warnings:
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Yu-Chun-Lin/dt-bindings-clock-Add-Realtek-RTD1625-Clock-Reset-Controller/20251229-155549
base: https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git clk-next
patch link: https://lore.kernel.org/r/20251229075313.27254-7-eleanor.lin%40realtek.com
patch subject: [PATCH 6/9] clk: realtek: Add support for mux clock
config: loongarch-randconfig-r072-20251231 (https://download.01.org/0day-ci/archive/20251231/202512310307.swVDgnPU-lkp@xxxxxxxxx/config)
compiler: loongarch64-linux-gcc (GCC) 12.5.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@xxxxxxxxx>
| Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
| Closes: https://lore.kernel.org/r/202512310307.swVDgnPU-lkp@xxxxxxxxx/
smatch warnings:
drivers/clk/realtek/clk-regmap-mux.c:23 clk_regmap_mux_get_parent() warn: signedness bug returning '(-22)'
vim +23 drivers/clk/realtek/clk-regmap-mux.c
f53de7a7df69f0 Yu-Chun Lin 2025-12-29 9 static u8 clk_regmap_mux_get_parent(struct clk_hw *hw)
^^
This function returns negative error codes so it needs to be type int.
f53de7a7df69f0 Yu-Chun Lin 2025-12-29 10 {
f53de7a7df69f0 Yu-Chun Lin 2025-12-29 11 struct clk_regmap_mux *clkm = to_clk_regmap_mux(hw);
f53de7a7df69f0 Yu-Chun Lin 2025-12-29 12 int num_parents = clk_hw_get_num_parents(hw);
f53de7a7df69f0 Yu-Chun Lin 2025-12-29 13 u32 val;
f53de7a7df69f0 Yu-Chun Lin 2025-12-29 14 int ret;
f53de7a7df69f0 Yu-Chun Lin 2025-12-29 15
f53de7a7df69f0 Yu-Chun Lin 2025-12-29 16 ret = regmap_read(clkm->clkr.regmap, clkm->mux_ofs, &val);
f53de7a7df69f0 Yu-Chun Lin 2025-12-29 17 if (ret)
f53de7a7df69f0 Yu-Chun Lin 2025-12-29 18 return ret;
f53de7a7df69f0 Yu-Chun Lin 2025-12-29 19
f53de7a7df69f0 Yu-Chun Lin 2025-12-29 20 val = val >> clkm->shift & clkm->mask;
f53de7a7df69f0 Yu-Chun Lin 2025-12-29 21
f53de7a7df69f0 Yu-Chun Lin 2025-12-29 22 if (val >= num_parents)
f53de7a7df69f0 Yu-Chun Lin 2025-12-29 @23 return -EINVAL;
f53de7a7df69f0 Yu-Chun Lin 2025-12-29 24
f53de7a7df69f0 Yu-Chun Lin 2025-12-29 25 return val;
f53de7a7df69f0 Yu-Chun Lin 2025-12-29 26 }
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki