From: kernel test robot <lkp@intel.com>
To: Cixi Geng <gengcixi@gmail.com>,
sre@kernel.org, orsonzhai@gmail.com, baolin.wang7@gmail.com,
zhang.lyra@gmail.com, chenyongzhi811@gmail.com
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] power: supply: Add enable the primary charger interface
Date: Sat, 23 Apr 2022 02:16:08 +0800 [thread overview]
Message-ID: <202204230206.9TgyhSb1-lkp@intel.com> (raw)
In-Reply-To: <20220422074109.1709106-1-gengcixi@gmail.com>
Hi Cixi,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on sre-power-supply/for-next]
[also build test WARNING on v5.18-rc3 next-20220422]
[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/intel-lab-lkp/linux/commits/Cixi-Geng/power-supply-Add-enable-the-primary-charger-interface/20220422-154432
base: https://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply.git for-next
config: riscv-randconfig-r042-20220422 (https://download.01.org/0day-ci/archive/20220423/202204230206.9TgyhSb1-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 5bd87350a5ae429baf8f373cb226a57b62f87280)
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 riscv cross compiling tool for clang build
# apt-get install binutils-riscv64-linux-gnu
# https://github.com/intel-lab-lkp/linux/commit/a566cf23ffad8453d1e1f611086b6eda3f14515d
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Cixi-Geng/power-supply-Add-enable-the-primary-charger-interface/20220422-154432
git checkout a566cf23ffad8453d1e1f611086b6eda3f14515d
# 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=riscv SHELL=/bin/bash drivers/power/supply/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> drivers/power/supply/sc2731_charger.c:156:13: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
} else if (val && !info->charging) {
^~~~~~~~~~~~~~~~~~~~~~
drivers/power/supply/sc2731_charger.c:164:9: note: uninitialized use occurs here
return ret;
^~~
drivers/power/supply/sc2731_charger.c:156:9: note: remove the 'if' if its condition is always true
} else if (val && !info->charging) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/power/supply/sc2731_charger.c:156:13: warning: variable 'ret' is used uninitialized whenever '&&' condition is false [-Wsometimes-uninitialized]
} else if (val && !info->charging) {
^~~
drivers/power/supply/sc2731_charger.c:164:9: note: uninitialized use occurs here
return ret;
^~~
drivers/power/supply/sc2731_charger.c:156:13: note: remove the '&&' if its condition is always true
} else if (val && !info->charging) {
^~~~~~
>> drivers/power/supply/sc2731_charger.c:153:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
if (!val && info->charging) {
^~~~~~~~~~~~~~~~~~~~~~
drivers/power/supply/sc2731_charger.c:164:9: note: uninitialized use occurs here
return ret;
^~~
drivers/power/supply/sc2731_charger.c:153:2: note: remove the 'if' if its condition is always false
if (!val && info->charging) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/power/supply/sc2731_charger.c:151:9: note: initialize the variable 'ret' to silence this warning
int ret;
^
= 0
drivers/power/supply/sc2731_charger.c:255:7: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
if (val->intval == true) {
^~~~~~~~~~~~~~~~~~~
drivers/power/supply/sc2731_charger.c:268:9: note: uninitialized use occurs here
return ret;
^~~
drivers/power/supply/sc2731_charger.c:255:3: note: remove the 'if' if its condition is always true
if (val->intval == true) {
^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/power/supply/sc2731_charger.c:225:9: note: initialize the variable 'ret' to silence this warning
int ret;
^
= 0
4 warnings generated.
vim +156 drivers/power/supply/sc2731_charger.c
148
149 static int sc2731_charger_set_status(struct sc2731_charger_info *info, int val)
150 {
151 int ret;
152
> 153 if (!val && info->charging) {
154 sc2731_charger_stop_charge(info);
155 info->charging = false;
> 156 } else if (val && !info->charging) {
157 ret = sc2731_charger_start_charge(info);
158 if (ret)
159 dev_err(info->dev, "start charge failed\n");
160 else
161 info->charging = true;
162 }
163
164 return ret;
165 }
166
--
0-DAY CI Kernel Test Service
https://01.org/lkp
prev parent reply other threads:[~2022-04-22 21:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-22 7:41 Cixi Geng
2022-04-22 18:16 ` kernel test robot [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202204230206.9TgyhSb1-lkp@intel.com \
--to=lkp@intel.com \
--cc=baolin.wang7@gmail.com \
--cc=chenyongzhi811@gmail.com \
--cc=gengcixi@gmail.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=orsonzhai@gmail.com \
--cc=sre@kernel.org \
--cc=zhang.lyra@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®