summaryrefslogtreecommitdiffstats
path: root/drivers/usb/typec/tcpm.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman2018-04-25 14:24:34 +0200
committerGreg Kroah-Hartman2018-04-25 14:24:34 +0200
commit0c718676ab3f02e98e85e7049e03d2879c62cb10 (patch)
treee217d1994de317ae4495ef94ea46314049084579 /drivers/usb/typec/tcpm.c
parenttypec: tcpm: Add support for sink PPS related messages (diff)
downloadkernel-qcow2-linux-0c718676ab3f02e98e85e7049e03d2879c62cb10.tar.gz
kernel-qcow2-linux-0c718676ab3f02e98e85e7049e03d2879c62cb10.tar.xz
kernel-qcow2-linux-0c718676ab3f02e98e85e7049e03d2879c62cb10.zip
typec: tcpm: fix compiler warning about stupid things
gcc thinks it is too smart and gives off a "you might be using this variable before it is initialized" warning in tcpm_pd_build_request(), because it can not follow the logic through the tcpm_pd_select_pdo() call. So just make gcc quiet by initializing things to 0, to prevent the myriad of people complaining that we now have a build warning. Cc: Adam Thomson <Adam.Thomson.Opensource@diasemi.com> Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com> Cc: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/typec/tcpm.c')
-rw-r--r--drivers/usb/typec/tcpm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/typec/tcpm.c b/drivers/usb/typec/tcpm.c
index 4483dc4162b0..1ee259bc14a5 100644
--- a/drivers/usb/typec/tcpm.c
+++ b/drivers/usb/typec/tcpm.c
@@ -2206,8 +2206,9 @@ static int tcpm_pd_build_request(struct tcpm_port *port, u32 *rdo)
unsigned int mv, ma, mw, flags;
unsigned int max_ma, max_mw;
enum pd_pdo_type type;
- int src_pdo_index, snk_pdo_index;
u32 pdo, matching_snk_pdo;
+ int src_pdo_index = 0;
+ int snk_pdo_index = 0;
int ret;
ret = tcpm_pd_select_pdo(port, &snk_pdo_index, &src_pdo_index);