
From: shenhao <shenhao21@huawei.com> driver inclusion category: bugfix bugzilla: NA CVE: NA -------------------------------------------- This patch optimizes the return process of hclge_enable_phy_loopback() and hclge_disable_phy_loopback() function for cleanup. Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com> Signed-off-by: shenhao <shenhao21@huawei.com> Reviewed-by: Zhong Zhaohui <zhongzhaohui@huawei.com> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index c05b595..324925a 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -6728,8 +6728,7 @@ static int hclge_enable_phy_loopback(struct hclge_dev *hdev, if (ret) return ret; - ret = phy_loopback(phydev, true); - return ret; + return phy_loopback(phydev, true); } static int hclge_disable_phy_loopback(struct hclge_dev *hdev, @@ -6741,8 +6740,7 @@ static int hclge_disable_phy_loopback(struct hclge_dev *hdev, if (ret) return ret; - ret = phy_suspend(phydev); - return ret; + return phy_suspend(phydev); } static int hclge_set_phy_loopback(struct hclge_dev *hdev, bool en) -- 1.8.3