提交 0c718676 编写于 作者: G Greg Kroah-Hartman

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: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 64f7c494
...@@ -2206,8 +2206,9 @@ static int tcpm_pd_build_request(struct tcpm_port *port, u32 *rdo) ...@@ -2206,8 +2206,9 @@ static int tcpm_pd_build_request(struct tcpm_port *port, u32 *rdo)
unsigned int mv, ma, mw, flags; unsigned int mv, ma, mw, flags;
unsigned int max_ma, max_mw; unsigned int max_ma, max_mw;
enum pd_pdo_type type; enum pd_pdo_type type;
int src_pdo_index, snk_pdo_index;
u32 pdo, matching_snk_pdo; u32 pdo, matching_snk_pdo;
int src_pdo_index = 0;
int snk_pdo_index = 0;
int ret; int ret;
ret = tcpm_pd_select_pdo(port, &snk_pdo_index, &src_pdo_index); ret = tcpm_pd_select_pdo(port, &snk_pdo_index, &src_pdo_index);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册