All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [freescale-fslc:5.4-2.3.x-imx 12732/16543] drivers/usb/typec/tcpm/tcpm.c:4726:7: warning: variable 'ret' is used uninitialized whenever switch case is taken
Date: Thu, 14 Jan 2021 17:27:48 +0800	[thread overview]
Message-ID: <202101141737.IbLiplYY-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 3181 bytes --]

tree:   https://github.com/Freescale/linux-fslc 5.4-2.3.x-imx
head:   a8a2b9ee4bec0b29d031324160b7f11af42a563a
commit: 7801f9a5347345b16fc4039c7b5b612403af0234 [12732/16543] MLK-24507-3 usb: typec: tcpm: add BC charger types if power type is usb
config: x86_64-randconfig-a004-20210114 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 6077d55381a6aa3e947ef7abdc36a7515c598c8a)
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 x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # https://github.com/Freescale/linux-fslc/commit/7801f9a5347345b16fc4039c7b5b612403af0234
        git remote add freescale-fslc https://github.com/Freescale/linux-fslc
        git fetch --no-tags freescale-fslc 5.4-2.3.x-imx
        git checkout 7801f9a5347345b16fc4039c7b5b612403af0234
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

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/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(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 33566 bytes --]

                 reply	other threads:[~2021-01-14  9:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202101141737.IbLiplYY-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.