[linux-next:master 4715/7526] drivers/power/supply/ab8500_chargalg.c:821:13: warning: variable 'delta_i_ua' set but not used

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   196d330d7fb1e7cc0d85641c89ce4602cb36f12e
commit: 05906f58c82259e42d053409abe7e23b4f88650e [4715/7526] power: supply: ab8500_chargalg: Drop charging step
config: arm-allyesconfig (https://download.01.org/0day-ci/archive/20220224/202202241012.mQayQSLZ-lkp@xxxxxxxxx/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/next/linux-next.git/commit/?id=05906f58c82259e42d053409abe7e23b4f88650e
        git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
        git fetch --no-tags linux-next master
        git checkout 05906f58c82259e42d053409abe7e23b4f88650e
        # 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 <lkp@xxxxxxxxx>

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:821:13: warning: variable 'delta_i_ua' set but not used [-Wunused-but-set-variable]
     821 |         int delta_i_ua;
         |             ^~~~~~~~~~


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

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

:::::: The code at line 821 was first introduced by commit
:::::: 83e5aa77d1120fd38101f757c4aeb985e9305700 power: supply: ab8500: Standardize CC current

:::::: TO: Linus Walleij <linus.walleij@xxxxxxxxxx>
:::::: CC: Sebastian Reichel <sebastian.reichel@xxxxxxxxxxxxx>

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




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux