Subject: [linusw-nomadik:ux500-href-charging-v5.16-rc1 47/58] drivers/power/supply/ab8500_chargalg.c:822:13: warning: variable 'delta_i_ua' set but not used

From: kernel test robot <[email-masked]>
Date: Mon, 17 Jan 2022 10:29:25 +0800

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik.git ux500-href-charging-v5.16-rc1
head:   1e846b0b60ac01cac4f283975a1bc395ff73d995
commit: e067307b004b5f2699464dd37d10817677ce9bf3 [47/58] power: supply: ab8500_chargalg: Drop charging step
config: arm-allyesconfig (https://download.01.org/0day-ci/archive/20220117/[email-masked]/config)
compiler: arm-linux-gnueabi-gcc (GCC) 11.2.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/linusw/linux-nomadik.git/commit/?id=e067307b004b5f2699464dd37d10817677ce9bf3
        git remote add linusw-nomadik https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik.git
        git fetch --no-tags linusw-nomadik ux500-href-charging-v5.16-rc1
        git checkout e067307b004b5f2699464dd37d10817677ce9bf3
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arm SHELL=/bin/bash drivers/power/supply/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email-masked]>

All warnings (new ones prefixed by >>):

   drivers/power/supply/ab8500_chargalg.c: In function 'ab8500_chargalg_chg_curr_maxim':
>> drivers/power/supply/ab8500_chargalg.c:822:13: warning: variable 'delta_i_ua' set but not used [-Wunused-but-set-variable]
     822 |         int delta_i_ua;
         |             ^~~~~~~~~~

vim +/delta_i_ua +822 drivers/power/supply/ab8500_chargalg.c

1668f81159fb72 drivers/power/abx500_chargalg.c        Arun Murthy   2012-02-29  810  
1668f81159fb72 drivers/power/abx500_chargalg.c        Arun Murthy   2012-02-29  811  /**
c5b64a990e7f3b drivers/power/supply/ab8500_chargalg.c Linus Walleij 2021-07-13  812   * ab8500_chargalg_chg_curr_maxim - increases the charger current to
1668f81159fb72 drivers/power/abx500_chargalg.c        Arun Murthy   2012-02-29  813   *			compensate for the system load
c5b64a990e7f3b drivers/power/supply/ab8500_chargalg.c Linus Walleij 2021-07-13  814   * @di		pointer to the ab8500_chargalg structure
1668f81159fb72 drivers/power/abx500_chargalg.c        Arun Murthy   2012-02-29  815   *
1668f81159fb72 drivers/power/abx500_chargalg.c        Arun Murthy   2012-02-29  816   * This maximization function is used to raise the charger current to get the
1668f81159fb72 drivers/power/abx500_chargalg.c        Arun Murthy   2012-02-29  817   * battery current as close to the optimal value as possible. The battery
1668f81159fb72 drivers/power/abx500_chargalg.c        Arun Murthy   2012-02-29  818   * current during charging is affected by the system load
1668f81159fb72 drivers/power/abx500_chargalg.c        Arun Murthy   2012-02-29  819   */
c5b64a990e7f3b drivers/power/supply/ab8500_chargalg.c Linus Walleij 2021-07-13  820  static enum maxim_ret ab8500_chargalg_chg_curr_maxim(struct ab8500_chargalg *di)
1668f81159fb72 drivers/power/abx500_chargalg.c        Arun Murthy   2012-02-29  821  {
d3e41d1547389a drivers/power/supply/ab8500_chargalg.c Linus Walleij 2021-11-13 @822  	int delta_i_ua;
1668f81159fb72 drivers/power/abx500_chargalg.c        Arun Murthy   2012-02-29  823  
b0284de05e07d5 drivers/power/abx500_chargalg.c        Lee Jones     2012-11-30  824  	if (!di->bm->maxi->ena_maxi)
1668f81159fb72 drivers/power/abx500_chargalg.c        Arun Murthy   2012-02-29  825  		return MAXIM_RET_NOACTION;
1668f81159fb72 drivers/power/abx500_chargalg.c        Arun Murthy   2012-02-29  826  
d3e41d1547389a drivers/power/supply/ab8500_chargalg.c Linus Walleij 2021-11-13  827  	delta_i_ua = di->ccm.original_iset_ua - di->batt_data.inst_curr_ua;
1668f81159fb72 drivers/power/abx500_chargalg.c        Arun Murthy   2012-02-29  828  
1668f81159fb72 drivers/power/abx500_chargalg.c        Arun Murthy   2012-02-29  829  	if (di->events.vbus_collapsed) {
1668f81159fb72 drivers/power/abx500_chargalg.c        Arun Murthy   2012-02-29  830  		dev_dbg(di->dev, "Charger voltage has collapsed %d\n",
1668f81159fb72 drivers/power/abx500_chargalg.c        Arun Murthy   2012-02-29  831  				di->ccm.wait_cnt);
1668f81159fb72 drivers/power/abx500_chargalg.c        Arun Murthy   2012-02-29  832  		if (di->ccm.wait_cnt == 0) {
1668f81159fb72 drivers/power/abx500_chargalg.c        Arun Murthy   2012-02-29  833  			dev_dbg(di->dev, "lowering current\n");
1668f81159fb72 drivers/power/abx500_chargalg.c        Arun Murthy   2012-02-29  834  			di->ccm.wait_cnt++;
b0284de05e07d5 drivers/power/abx500_chargalg.c        Lee Jones     2012-11-30  835  			di->ccm.condition_cnt = di->bm->maxi->wait_cycles;
e067307b004b5f drivers/power/supply/ab8500_chargalg.c Linus Walleij 2022-01-04  836  			di->ccm.max_current_ua = di->ccm.current_iset_ua;
d3e41d1547389a drivers/power/supply/ab8500_chargalg.c Linus Walleij 2021-11-13  837  			di->ccm.current_iset_ua = di->ccm.max_current_ua;
1668f81159fb72 drivers/power/abx500_chargalg.c        Arun Murthy   2012-02-29  838  			di->ccm.level--;
1668f81159fb72 drivers/power/abx500_chargalg.c        Arun Murthy   2012-02-29  839  			return MAXIM_RET_CHANGE;
1668f81159fb72 drivers/power/abx500_chargalg.c        Arun Murthy   2012-02-29  840  		} else {
1668f81159fb72 drivers/power/abx500_chargalg.c        Arun Murthy   2012-02-29  841  			dev_dbg(di->dev, "waiting\n");
1668f81159fb72 drivers/power/abx500_chargalg.c        Arun Murthy   2012-02-29  842  			/* Let's go in here twice before lowering curr again */
1668f81159fb72 drivers/power/abx500_chargalg.c        Arun Murthy   2012-02-29  843  			di->ccm.wait_cnt = (di->ccm.wait_cnt + 1) % 3;
1668f81159fb72 drivers/power/abx500_chargalg.c        Arun Murthy   2012-02-29  844  			return MAXIM_RET_NOACTION;
1668f81159fb72 drivers/power/abx500_chargalg.c        Arun Murthy   2012-02-29  845  		}
1668f81159fb72 drivers/power/abx500_chargalg.c        Arun Murthy   2012-02-29  846  	}
1668f81159fb72 drivers/power/abx500_chargalg.c        Arun Murthy   2012-02-29  847  
1668f81159fb72 drivers/power/abx500_chargalg.c        Arun Murthy   2012-02-29  848  	di->ccm.wait_cnt = 0;
1668f81159fb72 drivers/power/abx500_chargalg.c        Arun Murthy   2012-02-29  849  
d3e41d1547389a drivers/power/supply/ab8500_chargalg.c Linus Walleij 2021-11-13  850  	if (di->batt_data.inst_curr_ua > di->ccm.original_iset_ua) {
d3e41d1547389a drivers/power/supply/ab8500_chargalg.c Linus Walleij 2021-11-13  851  		dev_dbg(di->dev, " Maximization Ibat (%duA) too high"
d3e41d1547389a drivers/power/supply/ab8500_chargalg.c Linus Walleij 2021-11-13  852  			" (limit %duA) (current iset: %duA)!\n",
d3e41d1547389a drivers/power/supply/ab8500_chargalg.c Linus Walleij 2021-11-13  853  			di->batt_data.inst_curr_ua, di->ccm.original_iset_ua,
d3e41d1547389a drivers/power/supply/ab8500_chargalg.c Linus Walleij 2021-11-13  854  			di->ccm.current_iset_ua);
1668f81159fb72 drivers/power/abx500_chargalg.c        Arun Murthy   2012-02-29  855  
d3e41d1547389a drivers/power/supply/ab8500_chargalg.c Linus Walleij 2021-11-13  856  		if (di->ccm.current_iset_ua == di->ccm.original_iset_ua)
1668f81159fb72 drivers/power/abx500_chargalg.c        Arun Murthy   2012-02-29  857  			return MAXIM_RET_NOACTION;
1668f81159fb72 drivers/power/abx500_chargalg.c        Arun Murthy   2012-02-29  858  
b0284de05e07d5 drivers/power/abx500_chargalg.c        Lee Jones     2012-11-30  859  		di->ccm.condition_cnt = di->bm->maxi->wait_cycles;
d3e41d1547389a drivers/power/supply/ab8500_chargalg.c Linus Walleij 2021-11-13  860  		di->ccm.current_iset_ua = di->ccm.original_iset_ua;
1668f81159fb72 drivers/power/abx500_chargalg.c        Arun Murthy   2012-02-29  861  		di->ccm.level = 0;
1668f81159fb72 drivers/power/abx500_chargalg.c        Arun Murthy   2012-02-29  862  
1668f81159fb72 drivers/power/abx500_chargalg.c        Arun Murthy   2012-02-29  863  		return MAXIM_RET_IBAT_TOO_HIGH;
1668f81159fb72 drivers/power/abx500_chargalg.c        Arun Murthy   2012-02-29  864  	}
1668f81159fb72 drivers/power/abx500_chargalg.c        Arun Murthy   2012-02-29  865  
b0284de05e07d5 drivers/power/abx500_chargalg.c        Lee Jones     2012-11-30  866  	di->ccm.condition_cnt = di->bm->maxi->wait_cycles;
1668f81159fb72 drivers/power/abx500_chargalg.c        Arun Murthy   2012-02-29  867  	return MAXIM_RET_NOACTION;
1668f81159fb72 drivers/power/abx500_chargalg.c        Arun Murthy   2012-02-29  868  }
1668f81159fb72 drivers/power/abx500_chargalg.c        Arun Murthy   2012-02-29  869  

:::::: The code at line 822 was first introduced by commit
:::::: d3e41d1547389a87ac7b6c311ed8243d0fc9fa7b power: supply: ab8500: Standardize CC current

:::::: TO: Linus Walleij <[email-masked]>
:::::: CC: Linus Walleij <[email-masked]>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email-masked]

_______________________________________________
linux-arm-kernel mailing list
[email-masked]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel