[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202506241156.TWxCzjh3-lkp@intel.com>
Date: Tue, 24 Jun 2025 11:56:58 +0800
From: kernel test robot <lkp@...el.com>
To: AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
broonie@...nel.org
Cc: llvm@...ts.linux.dev, oe-kbuild-all@...ts.linux.dev,
lgirdwood@...il.com, robh@...nel.org, krzk+dt@...nel.org,
conor+dt@...nel.org, matthias.bgg@...il.com,
angelogioacchino.delregno@...labora.com,
linux-kernel@...r.kernel.org, devicetree@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org, kernel@...labora.com
Subject: Re: [PATCH v1 2/6] regulator: Add support for MediaTek MT6316 SPMI
PMIC Regulators
Hi AngeloGioacchino,
kernel test robot noticed the following build warnings:
[auto build test WARNING on broonie-regulator/for-next]
[also build test WARNING on linus/master v6.16-rc3 next-20250623]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/AngeloGioacchino-Del-Regno/dt-bindings-regulator-Document-MediaTek-MT6316-PMIC-Regulators/20250623-200316
base: https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-next
patch link: https://lore.kernel.org/r/20250623120016.108732-3-angelogioacchino.delregno%40collabora.com
patch subject: [PATCH v1 2/6] regulator: Add support for MediaTek MT6316 SPMI PMIC Regulators
config: i386-buildonly-randconfig-004-20250624 (https://download.01.org/0day-ci/archive/20250624/202506241156.TWxCzjh3-lkp@intel.com/config)
compiler: clang version 20.1.2 (https://github.com/llvm/llvm-project 58df0ef89dd64126512e4ee27b4ac3fd8ddf6247)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250624/202506241156.TWxCzjh3-lkp@intel.com/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 <lkp@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202506241156.TWxCzjh3-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/regulator/mt6316-regulator.c:205:14: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
205 | } else if (cur_mode == REGULATOR_MODE_IDLE) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/regulator/mt6316-regulator.c:218:6: note: uninitialized use occurs here
218 | if (ret) {
| ^~~
drivers/regulator/mt6316-regulator.c:205:10: note: remove the 'if' if its condition is always true
205 | } else if (cur_mode == REGULATOR_MODE_IDLE) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/regulator/mt6316-regulator.c:189:19: note: initialize the variable 'ret' to silence this warning
189 | int cur_mode, ret;
| ^
| = 0
>> drivers/regulator/mt6316-regulator.c:193:25: warning: variable 'regmap' is uninitialized when used here [-Wuninitialized]
193 | ret = regmap_set_bits(regmap, info->modeset_reg, info->modeset_mask);
| ^~~~~~
drivers/regulator/mt6316-regulator.c:188:23: note: initialize the variable 'regmap' to silence this warning
188 | struct regmap *regmap;
| ^
| = NULL
2 warnings generated.
vim +205 drivers/regulator/mt6316-regulator.c
183
184 static int mt6316_regulator_set_mode(struct regulator_dev *rdev,
185 unsigned int mode)
186 {
187 struct mt6316_regulator_info *info = rdev_get_drvdata(rdev);
188 struct regmap *regmap;
189 int cur_mode, ret;
190
191 switch (mode) {
192 case REGULATOR_MODE_FAST:
> 193 ret = regmap_set_bits(regmap, info->modeset_reg, info->modeset_mask);
194 break;
195 case REGULATOR_MODE_NORMAL:
196 cur_mode = mt6316_regulator_get_mode(rdev);
197 if (cur_mode < 0) {
198 ret = cur_mode;
199 break;
200 }
201
202 if (cur_mode == REGULATOR_MODE_FAST) {
203 ret = regmap_clear_bits(regmap, info->modeset_reg, info->modeset_mask);
204 break;
> 205 } else if (cur_mode == REGULATOR_MODE_IDLE) {
206 ret = regmap_clear_bits(regmap, info->lp_mode_reg, info->lp_mode_mask);
207 if (ret == 0)
208 usleep_range(100, 200);
209 }
210 break;
211 case REGULATOR_MODE_IDLE:
212 ret = regmap_set_bits(regmap, info->lp_mode_reg, info->lp_mode_mask);
213 break;
214 default:
215 ret = -EINVAL;
216 }
217
218 if (ret) {
219 dev_err(&rdev->dev, "Failed to set mode %u: %d\n", mode, ret);
220 return ret;
221 }
222
223 return 0;
224 }
225
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Powered by blists - more mailing lists