Re: [PATCH v2 6/9] power: supply: rt5033_charger: Add RT5033 charger device driver

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

 



Hi Sebastian,

On 23.04.23 03:22, kernel test robot wrote:
Hi Jakob,

kernel test robot noticed the following build warnings:

[auto build test WARNING on lee-mfd/for-mfd-next]
[also build test WARNING on next-20230421]
[cannot apply to sre-power-supply/for-next broonie-regulator/for-next linus/master lee-mfd/for-mfd-fixes v6.3-rc7]
[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/Jakob-Hauser/mfd-rt5033-Fix-chip-revision-readout/20230416-214502
base:   https://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git for-mfd-next
patch link:    https://lore.kernel.org/r/665d8906ea7b84e0a248315e8395a80007b8bafb.1681646904.git.jahau%40rocketmail.com
patch subject: [PATCH v2 6/9] power: supply: rt5033_charger: Add RT5033 charger device driver
config: x86_64-allmodconfig (https://download.01.org/0day-ci/archive/20230423/202304230924.lqgvPwZ0-lkp@xxxxxxxxx/config)
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
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://github.com/intel-lab-lkp/linux/commit/0fbd385f9a1acd55a8d943560428b9d783f8047f
         git remote add linux-review https://github.com/intel-lab-lkp/linux
         git fetch --no-tags linux-review Jakob-Hauser/mfd-rt5033-Fix-chip-revision-readout/20230416-214502
         git checkout 0fbd385f9a1acd55a8d943560428b9d783f8047f
         # save the config file
         mkdir build_dir && cp config build_dir/.config
         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 olddefconfig
         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash arch/x86/xen/ drivers/power/supply/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Link: https://lore.kernel.org/oe-kbuild-all/202304230924.lqgvPwZ0-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

drivers/power/supply/rt5033_charger.c:26:10: warning: variable 'state' is uninitialized when used here [-Wuninitialized]
                    return state;
                           ^~~~~
    drivers/power/supply/rt5033_charger.c:23:11: note: initialize the variable 'state' to silence this warning
            int state;
                     ^
                      = 0
    1 warning generated.


vim +/state +26 drivers/power/supply/rt5033_charger.c

     18	
     19	static int rt5033_get_charger_state(struct rt5033_charger *charger)
     20	{
     21		struct regmap *regmap = charger->rt5033->regmap;
     22		unsigned int reg_data;
     23		int state;
     24	
     25		if (!regmap)
   > 26			return state;
     27	
     28		regmap_read(regmap, RT5033_REG_CHG_STAT, &reg_data);
     29	
     30		switch (reg_data & RT5033_CHG_STAT_MASK) {
     31		case RT5033_CHG_STAT_DISCHARGING:
     32			state = POWER_SUPPLY_STATUS_DISCHARGING;
     33			break;
     34		case RT5033_CHG_STAT_CHARGING:
     35			state = POWER_SUPPLY_STATUS_CHARGING;
     36			break;
     37		case RT5033_CHG_STAT_FULL:
     38			state = POWER_SUPPLY_STATUS_FULL;
     39			break;
     40		case RT5033_CHG_STAT_NOT_CHARGING:
     41			state = POWER_SUPPLY_STATUS_NOT_CHARGING;
     42			break;
     43		default:
     44			state = POWER_SUPPLY_STATUS_UNKNOWN;
     45		}
     46	
     47		return state;
     48	}
     49	


Here as well I'll change "return state;" into "return POWER_SUPPLY_STATUS_UNKNOWN;". If the driver fails to get the regmap, the status is "unknown".

Kind regards,
Jakob



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux