提交 546d6bad 编写于 作者: P Peter Geis 提交者: Jakub Kicinski

net: phy: fix yt8511 clang uninitialized variable warning

clang doesn't preinitialize variables. If phy_select_page failed and
returned an error, phy_restore_page would be called with `ret` being
uninitialized.
Even though phy_restore_page won't use `ret` in this scenario,
initialize `ret` to silence the warning.

Fixes: 48e8c6f1 ("net: phy: add driver for Motorcomm yt8511 phy")
Reported-by: Nkernel test robot <lkp@intel.com>
Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
Signed-off-by: NPeter Geis <pgwipeout@gmail.com>
Signed-off-by: NJakub Kicinski <kuba@kernel.org>
上级 8b97f36a
......@@ -50,8 +50,8 @@ static int yt8511_write_page(struct phy_device *phydev, int page)
static int yt8511_config_init(struct phy_device *phydev)
{
int oldpage, ret = 0;
unsigned int ge, fe;
int ret, oldpage;
/* set clock mode to 125mhz */
oldpage = phy_select_page(phydev, YT8511_EXT_CLK_GATE);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册