Re: [PATCH v3] power: supply: sbs-battery: cache constant string properties

From: kernel test robot
Date: Wed May 26 2021 - 05:01:15 EST


Hi Ikjoon,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on power-supply/for-next]
[also build test ERROR on v5.13-rc3 next-20210525]
[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]

url: https://github.com/0day-ci/linux/commits/Ikjoon-Jang/power-supply-sbs-battery-cache-constant-string-properties/20210526-132701
base: https://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply.git for-next
config: arm-randconfig-r036-20210526 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 99155e913e9bad5f7f8a247f8bb3a3ff3da74af1)
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
# install arm cross compiling tool for clang build
# apt-get install binutils-arm-linux-gnueabi
# https://github.com/0day-ci/linux/commit/584859e4c0fe02c3c7b9b4e8c4a2c99d5212fe21
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Ikjoon-Jang/power-supply-sbs-battery-cache-constant-string-properties/20210526-132701
git checkout 584859e4c0fe02c3c7b9b4e8c4a2c99d5212fe21
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All error/warnings (new ones prefixed by >>):

>> drivers/power/supply/sbs-battery.c:236:27: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
if (chip->strings[i][0] = 0;
~~~~~~~~~~~~~~~~~~~~^~~
drivers/power/supply/sbs-battery.c:236:27: note: place parentheses around the assignment to silence this warning
if (chip->strings[i][0] = 0;
^
( )
drivers/power/supply/sbs-battery.c:236:27: note: use '==' to turn this assignment into an equality comparison
if (chip->strings[i][0] = 0;
^
==
>> drivers/power/supply/sbs-battery.c:236:30: error: expected ')'
if (chip->strings[i][0] = 0;
^
drivers/power/supply/sbs-battery.c:236:6: note: to match this '('
if (chip->strings[i][0] = 0;
^
>> drivers/power/supply/sbs-battery.c:236:30: warning: if statement has empty body [-Wempty-body]
if (chip->strings[i][0] = 0;
^
drivers/power/supply/sbs-battery.c:236:30: note: put the semicolon on a separate line to silence this warning
2 warnings and 1 error generated.


vim +236 drivers/power/supply/sbs-battery.c

228
229 static void sbs_invalidate_cached_props(struct sbs_info *chip)
230 {
231 int i = 0;
232
233 chip->technology = -1;
234
235 for (i = 0; i < NR_STRING_BUFFERS; i++)
> 236 if (chip->strings[i][0] = 0;
237 }
238

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip