Hi Matti,
[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on 09162bc32c880a791c6c0668ce0745cf7958f576]
url:
https://github.com/0day-ci/linux/commits/Matti-Vaittinen/power-supply-Add...
base: 09162bc32c880a791c6c0668ce0745cf7958f576
config: arm64-randconfig-r005-20201210 (attached as .config)
compiler: clang version 12.0.0 (
https://github.com/llvm/llvm-project
1968804ac726e7674d5de22bc2204b45857da344)
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 arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
#
https://github.com/0day-ci/linux/commit/d7d68650b1fb6da80b5ba5953454bae6b...
git remote add linux-review
https://github.com/0day-ci/linux
git fetch --no-tags linux-review
Matti-Vaittinen/power-supply-Add-some-fuel-gauge-logic/20201204-205731
git checkout d7d68650b1fb6da80b5ba5953454bae6bbe420da
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
> drivers/power/supply/power_supply_swgauge.c:105:2: warning:
variable 'ret' is used uninitialized whenever 'if' condition is false
[-Wsometimes-uninitialized]
if (sw->ops.set_cycle)
^~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:56:28: note: expanded from macro 'if'
#define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:58:30: note: expanded from macro '__trace_if_var'
#define __trace_if_var(cond) (__builtin_constant_p(cond) ? (cond) :
__trace_if_value(cond))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/power/supply/power_supply_swgauge.c:111:9: note: uninitialized use occurs here
return ret;
^~~
drivers/power/supply/power_supply_swgauge.c:105:2: note: remove the 'if' if its
condition is always true
if (sw->ops.set_cycle)
^~~~~~~~~~~~~~~~~~~~~~
include/linux/compiler.h:56:23: note: expanded from macro 'if'
#define if(cond, ...) if ( __trace_if_var( !!(cond , ## __VA_ARGS__) ) )
^
drivers/power/supply/power_supply_swgauge.c:100:9: note: initialize the variable
'ret' to silence this warning
int ret, old_cycle = sw->cycle;
^
= 0
drivers/power/supply/power_supply_swgauge.c:818:6: warning: no previous prototype for
function 'stop_gauge_thread' [-Wmissing-prototypes]
void stop_gauge_thread(struct task_struct *k)
^
drivers/power/supply/power_supply_swgauge.c:818:1: note: declare 'static' if
the function is not intended to be used outside of this translation unit
void stop_gauge_thread(struct task_struct *k)
^
static
2 warnings generated.
vim +105 drivers/power/supply/power_supply_swgauge.c
97
98 static int swgauge_set_cycle(struct sw_gauge *sw, int new_cycle)
99 {
100 int ret, old_cycle = sw->cycle;
101
102 if (!sw->desc->allow_set_cycle && !sw->ops.set_cycle)
103 return -EINVAL;
104
105 if (sw->ops.set_cycle)
106 ret =
sw->ops.set_cycle(sw, old_cycle, &new_cycle);
107
108 if (!ret)
109 sw->cycle = new_cycle;
110
111 return ret;
112 }
113
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org