Re: [PATCH 4/7] i2c: stm32f7: add support for stm32mp25 soc

From: kernel test robot
Date: Wed Nov 29 2023 - 18:10:32 EST


Hi Alain,

kernel test robot noticed the following build warnings:

[auto build test WARNING on wsa/i2c/for-next]
[also build test WARNING on atorgue-stm32/stm32-next robh/for-next linus/master v6.7-rc3 next-20231129]
[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/Alain-Volmat/i2c-stm32f7-perform-most-of-irq-job-in-threaded-handler/20231129-210806
base: https://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git i2c/for-next
patch link: https://lore.kernel.org/r/20231129125920.1702497-5-alain.volmat%40foss.st.com
patch subject: [PATCH 4/7] i2c: stm32f7: add support for stm32mp25 soc
config: arm-defconfig (https://download.01.org/0day-ci/archive/20231130/202311300357.qiYAoEvz-lkp@xxxxxxxxx/config)
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project.git f28c006a5895fc0e329fe15fead81e37457cb1d1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231130/202311300357.qiYAoEvz-lkp@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202311300357.qiYAoEvz-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

>> drivers/i2c/busses/i2c-stm32f7.c:2029:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
if (i2c_dev->setup.fmp_cr1_bit) {
^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/i2c/busses/i2c-stm32f7.c:2044:9: note: uninitialized use occurs here
return ret;
^~~
drivers/i2c/busses/i2c-stm32f7.c:2029:2: note: remove the 'if' if its condition is always false
if (i2c_dev->setup.fmp_cr1_bit) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/i2c/busses/i2c-stm32f7.c:2022:9: note: initialize the variable 'ret' to silence this warning
int ret;
^
= 0
1 warning generated.


vim +2029 drivers/i2c/busses/i2c-stm32f7.c

2018
2019 static int stm32f7_i2c_write_fm_plus_bits(struct stm32f7_i2c_dev *i2c_dev,
2020 bool enable)
2021 {
2022 int ret;
2023
2024 if (i2c_dev->bus_rate <= I2C_MAX_FAST_MODE_FREQ ||
2025 (!i2c_dev->setup.fmp_cr1_bit && IS_ERR_OR_NULL(i2c_dev->regmap)))
2026 /* Optional */
2027 return 0;
2028
> 2029 if (i2c_dev->setup.fmp_cr1_bit) {
2030 if (enable)
2031 stm32f7_i2c_set_bits(i2c_dev->base + STM32F7_I2C_CR1, STM32_I2C_CR1_FMP);
2032 else
2033 stm32f7_i2c_clr_bits(i2c_dev->base + STM32F7_I2C_CR1, STM32_I2C_CR1_FMP);
2034 } else {
2035 if (i2c_dev->fmp_sreg == i2c_dev->fmp_creg)
2036 ret = regmap_update_bits(i2c_dev->regmap, i2c_dev->fmp_sreg,
2037 i2c_dev->fmp_mask, enable ? i2c_dev->fmp_mask : 0);
2038 else
2039 ret = regmap_write(i2c_dev->regmap,
2040 enable ? i2c_dev->fmp_sreg : i2c_dev->fmp_creg,
2041 i2c_dev->fmp_mask);
2042 }
2043
2044 return ret;
2045 }
2046

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