mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 03:15:31 +09:00
UPSTREAM: 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:48e8c6f161("net: phy: add driver for Motorcomm yt8511 phy") Reported-by: kernel test robot <lkp@intel.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Peter Geis <pgwipeout@gmail.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: David Wu <david.wu@rock-chips.com> (cherry-pick from commit546d6bad18) Change-Id: I0467ca4b5846e71ddca8a6818e5c021010a72d98
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user