lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Sun, 23 Apr 2023 11:55:52 +0200
From:   Jakob Hauser <jahau@...ketmail.com>
To:     Sebastian Reichel <sre@...nel.org>
Cc:     Lee Jones <lee@...nel.org>, Liam Girdwood <lgirdwood@...il.com>,
        Mark Brown <broonie@...nel.org>,
        Rob Herring <robh+dt@...nel.org>,
        Krzysztof Kozlowski <krzk@...nel.org>,
        Beomho Seo <beomho.seo@...sung.com>,
        Chanwoo Choi <cw00.choi@...sung.com>,
        Stephan Gerhold <stephan@...hold.net>,
        Raymond Hackley <raymondhackley@...tonmail.com>,
        Pavel Machek <pavel@....cz>, Axel Lin <axel.lin@...ics.com>,
        ChiYuan Huang <cy_huang@...htek.com>,
        Linus Walleij <linus.walleij@...aro.org>,
        linux-pm@...r.kernel.org, devicetree@...r.kernel.org,
        linux-kernel@...r.kernel.org, phone-devel@...r.kernel.org,
        ~postmarketos/upstreaming@...ts.sr.ht
Subject: Re: [PATCH v2 6/9] power: supply: rt5033_charger: Add RT5033 charger
 device driver

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@intel.com/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@...el.com>
> | Link: https://lore.kernel.org/oe-kbuild-all/202304230924.lqgvPwZ0-lkp@intel.com/
> 
> 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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ