Hi Li,
FYI, the error/warning still remains.
tree:
https://github.com/Freescale/linux-fslc pr/517
head: 0156d956a951c70743d2338132662b29aeb8847d
commit: 7801f9a5347345b16fc4039c7b5b612403af0234 [12732/22155] MLK-24507-3 usb: typec:
tcpm: add BC charger types if power type is usb
config: x86_64-randconfig-a014
(
https://download.01.org/0day-ci/archive/20220113/202201130650.504Wy7MQ-lk...)
compiler: clang version 14.0.0 (
https://github.com/llvm/llvm-project
244dd2913a43a200f5a6544d424cdc37b771028b)
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/Freescale/linux-fslc/commit/7801f9a5347345b16fc4039c7b...
git remote add freescale-fslc
https://github.com/Freescale/linux-fslc
git fetch --no-tags freescale-fslc pr/517
git checkout 7801f9a5347345b16fc4039c7b5b612403af0234
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir
ARCH=x86_64 SHELL=/bin/bash drivers/usb/typec/tcpm/
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/usb/typec/tcpm/tcpm.c:4726:7: warning: variable
'ret' is used uninitialized whenever switch case is taken
[-Wsometimes-uninitialized]
case POWER_SUPPLY_PROP_USB_TYPE:
^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/usb/typec/tcpm/tcpm.c:4734:9: note: uninitialized use occurs here
return ret;
^~~
drivers/usb/typec/tcpm/tcpm.c:4707:9: note: initialize the variable 'ret' to
silence this warning
int ret;
^
= 0
1 warning generated.
vim +/ret +4726 drivers/usb/typec/tcpm/tcpm.c
4701
4702 static int tcpm_psy_set_prop(struct power_supply *psy,
4703 enum power_supply_property psp,
4704 const union power_supply_propval *val)
4705 {
4706 struct tcpm_port *port = power_supply_get_drvdata(psy);
4707 int ret;
4708
4709 switch (psp) {
4710 case POWER_SUPPLY_PROP_ONLINE:
4711 ret = tcpm_psy_set_online(port, val);
4712 break;
4713 case POWER_SUPPLY_PROP_VOLTAGE_NOW:
4714 if (val->intval < port->pps_data.min_volt * 1000 ||
4715 val->intval > port->pps_data.max_volt * 1000)
4716 ret = -EINVAL;
4717 else
4718 ret = tcpm_pps_set_out_volt(port, val->intval / 1000);
4719 break;
4720 case POWER_SUPPLY_PROP_CURRENT_NOW:
4721 if (val->intval > port->pps_data.max_curr * 1000)
4722 ret = -EINVAL;
4723 else
4724 ret = tcpm_pps_set_op_curr(port, val->intval / 1000);
4725 break;
4726 case POWER_SUPPLY_PROP_USB_TYPE:
4727 port->usb_type = val->intval;
4728 break;
4729 default:
4730 ret = -EINVAL;
4731 break;
4732 }
4733
4734 return ret;
4735 }
4736
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org