:::::: :::::: Manual check reason: "low confidence bisect report" :::::: Manual check reason: "low confidence static check warning: drivers/regulator/mt6397-regulator.c:179:13: warning: shift by negative count ('-1') [-Wanalyzer-shift-count-negative]" ::::::
CC: kbuild-...@lists.01.org BCC: l...@intel.com CC: linux-ker...@vger.kernel.org TO: Axel Lin <axel....@ingics.com> CC: Mark Brown <broo...@kernel.org> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: ca1fdab7fd27eb069df1384b2850dcd0c2bebe8d commit: 12401a1cef787167aff52ef2dd28286e61054c38 regulator: mt6397: Remove modeset_shift from struct mt6397_regulator_info date: 12 months ago :::::: branch date: 14 hours ago :::::: commit date: 12 months ago config: arm-randconfig-c002-20220622 (https://download.01.org/0day-ci/archive/20220622/202206221448.ngowkgbr-...@intel.com/config) compiler: arm-linux-gnueabi-gcc (GCC) 11.3.0 reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=12401a1cef787167aff52ef2dd28286e61054c38 git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git git fetch --no-tags linus master git checkout 12401a1cef787167aff52ef2dd28286e61054c38 # save the config file ARCH=arm KBUILD_USERCFLAGS='-fanalyzer -Wno-error' If you fix the issue, kindly add following tag where applicable Reported-by: kernel test robot <l...@intel.com> gcc-analyzer warnings: (new ones prefixed by >>) In function 'mt6397_regulator_set_mode': >> drivers/regulator/mt6397-regulator.c:179:13: warning: shift by negative >> count ('-1') [-Wanalyzer-shift-count-negative] 179 | val <<= ffs(info->modeset_mask) - 1; | ^~~ 'mt6397_regulator_set_mode': events 1-2 | | 158 | static int mt6397_regulator_set_mode(struct regulator_dev *rdev, | | ^~~~~~~~~~~~~~~~~~~~~~~~~ | | | | | (1) entry to 'mt6397_regulator_set_mode' |...... | 179 | val <<= ffs(info->modeset_mask) - 1; | | ~~~~~~~~~~~~~~~~~~~~~~~ | | | | | (2) calling 'ffs' from 'mt6397_regulator_set_mode' | +--> 'ffs': events 3-4 | |include/asm-generic/bitops/ffs.h:13:19: | 13 | static inline int ffs(int x) | | ^~~ | | | | | (3) entry to 'ffs' |...... | 17 | if (!x) | | ~ | | | | | (4) following 'true' branch (when 'x == 0')... | 'ffs': event 5 | |cc1: | (5): ...to here | <------+ | 'mt6397_regulator_set_mode': events 6-7 | |drivers/regulator/mt6397-regulator.c:179:17: | 179 | val <<= ffs(info->modeset_mask) - 1; | | ~~~ ^~~~~~~~~~~~~~~~~~~~~~~ | | | | | | | (6) returning to 'mt6397_regulator_set_mode' from 'ffs' | | (7) shift by negative amount here ('-1') | In function 'mt6397_regulator_get_mode': drivers/regulator/mt6397-regulator.c:206:16: warning: shift by negative count ('-1') [-Wanalyzer-shift-count-negative] 206 | regval >>= ffs(info->modeset_mask) - 1; | ^~~ 'mt6397_regulator_get_mode': events 1-4 | | 193 | static unsigned int mt6397_regulator_get_mode(struct regulator_dev *rdev) | | ^~~~~~~~~~~~~~~~~~~~~~~~~ | | | | | (1) entry to 'mt6397_regulator_get_mode' |...... | 199 | if (ret != 0) { | | ~ | | | | | (2) following 'false' branch (when 'ret == 0')... |...... | 205 | regval &= info->modeset_mask; | | ~~~~~~~~~~~~~~~~~~ | | | | | (3) ...to here | 206 | regval >>= ffs(info->modeset_mask) - 1; | | ~~~~~~~~~~~~~~~~~~~~~~~ | | | | | (4) calling 'ffs' from 'mt6397_regulator_get_mode' | +--> 'ffs': events 5-6 | |include/asm-generic/bitops/ffs.h:13:19: | 13 | static inline int ffs(int x) | | ^~~ | | | | | (5) entry to 'ffs' |...... | 17 | if (!x) | | ~ | | | | | (6) following 'true' branch (when 'x == 0')... | 'ffs': event 7 | |cc1: | (7): ...to here | <------+ | 'mt6397_regulator_get_mode': events 8-9 | |drivers/regulator/mt6397-regulator.c:206:20: | 206 | regval >>= ffs(info->modeset_mask) - 1; | | ~~~ ^~~~~~~~~~~~~~~~~~~~~~~ | | | | | | | (8) returning to 'mt6397_regulator_get_mode' from 'ffs' | | (9) shift by negative amount here ('-1') | vim +179 drivers/regulator/mt6397-regulator.c 8096236db4349c Anand K Mistry 2020-07-02 157 05692513272231 Henry Chen 2016-05-23 158 static int mt6397_regulator_set_mode(struct regulator_dev *rdev, 05692513272231 Henry Chen 2016-05-23 159 unsigned int mode) 05692513272231 Henry Chen 2016-05-23 160 { 05692513272231 Henry Chen 2016-05-23 161 struct mt6397_regulator_info *info = rdev_get_drvdata(rdev); 05692513272231 Henry Chen 2016-05-23 162 int ret, val; 05692513272231 Henry Chen 2016-05-23 163 05692513272231 Henry Chen 2016-05-23 164 switch (mode) { 05692513272231 Henry Chen 2016-05-23 165 case REGULATOR_MODE_FAST: 05692513272231 Henry Chen 2016-05-23 166 val = MT6397_BUCK_MODE_FORCE_PWM; 05692513272231 Henry Chen 2016-05-23 167 break; 05692513272231 Henry Chen 2016-05-23 168 case REGULATOR_MODE_NORMAL: 05692513272231 Henry Chen 2016-05-23 169 val = MT6397_BUCK_MODE_AUTO; 05692513272231 Henry Chen 2016-05-23 170 break; 05692513272231 Henry Chen 2016-05-23 171 default: 05692513272231 Henry Chen 2016-05-23 172 ret = -EINVAL; 05692513272231 Henry Chen 2016-05-23 173 goto err_mode; 05692513272231 Henry Chen 2016-05-23 174 } 05692513272231 Henry Chen 2016-05-23 175 12401a1cef7871 Axel Lin 2021-06-29 176 dev_dbg(&rdev->dev, "mt6397 buck set_mode %#x, %#x, %#x\n", 12401a1cef7871 Axel Lin 2021-06-29 177 info->modeset_reg, info->modeset_mask, val); 12401a1cef7871 Axel Lin 2021-06-29 178 12401a1cef7871 Axel Lin 2021-06-29 @179 val <<= ffs(info->modeset_mask) - 1; 05692513272231 Henry Chen 2016-05-23 180 05692513272231 Henry Chen 2016-05-23 181 ret = regmap_update_bits(rdev->regmap, info->modeset_reg, 05692513272231 Henry Chen 2016-05-23 182 info->modeset_mask, val); 05692513272231 Henry Chen 2016-05-23 183 err_mode: 05692513272231 Henry Chen 2016-05-23 184 if (ret != 0) { 05692513272231 Henry Chen 2016-05-23 185 dev_err(&rdev->dev, 05692513272231 Henry Chen 2016-05-23 186 "Failed to set mt6397 buck mode: %d\n", ret); 05692513272231 Henry Chen 2016-05-23 187 return ret; 05692513272231 Henry Chen 2016-05-23 188 } 05692513272231 Henry Chen 2016-05-23 189 05692513272231 Henry Chen 2016-05-23 190 return 0; 05692513272231 Henry Chen 2016-05-23 191 } 05692513272231 Henry Chen 2016-05-23 192 -- 0-DAY CI Kernel Test Service https://01.org/lkp _______________________________________________ kbuild mailing list -- kbuild@lists.01.org To unsubscribe send an email to kbuild-le...@lists.01.org