From: Peter Geis Date: Sat, 29 May 2021 11:05:55 +0000 (-0400) Subject: net: phy: fix yt8511 clang uninitialized variable warning X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=546d6bad18c04926c4d0eba4222654a9a60ea830;p=uclinux-h8%2Flinux.git 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: 48e8c6f1612b ("net: phy: add driver for Motorcomm yt8511 phy") Reported-by: kernel test robot Reviewed-by: Andrew Lunn Signed-off-by: Peter Geis Signed-off-by: Jakub Kicinski --- diff --git a/drivers/net/phy/motorcomm.c b/drivers/net/phy/motorcomm.c index 796b68f4b499..68cd19540c67 100644 --- a/drivers/net/phy/motorcomm.c +++ b/drivers/net/phy/motorcomm.c @@ -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);