From patchwork Mon Sep 7 13:02:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhang Changzhong X-Patchwork-Id: 1358928 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=huawei.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4BlT5T1XrWz9sSP for ; Mon, 7 Sep 2020 23:04:45 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729368AbgIGNET (ORCPT ); Mon, 7 Sep 2020 09:04:19 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:59776 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729318AbgIGNDK (ORCPT ); Mon, 7 Sep 2020 09:03:10 -0400 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 10F611C9B9968BC436E5; Mon, 7 Sep 2020 21:03:07 +0800 (CST) Received: from localhost.localdomain (10.175.112.70) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server (TLS) id 14.3.487.0; Mon, 7 Sep 2020 21:03:03 +0800 From: Zhang Changzhong To: , , , CC: , Subject: [PATCH net-next] net: xilinx: remove redundant null check before clk_disable_unprepare() Date: Mon, 7 Sep 2020 21:02:03 +0800 Message-ID: <1599483723-43704-1-git-send-email-zhangchangzhong@huawei.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 X-Originating-IP: [10.175.112.70] X-CFilter-Loop: Reflected Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Because clk_prepare_enable() and clk_disable_unprepare() already checked NULL clock parameter, so the additional checks are unnecessary, just remove them. Reported-by: Hulk Robot Signed-off-by: Zhang Changzhong Reviewed-by: Radhey Shyam Pandey --- drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c index fa5dc299..9aafd3e 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c @@ -2038,8 +2038,7 @@ static int axienet_remove(struct platform_device *pdev) axienet_mdio_teardown(lp); - if (lp->clk) - clk_disable_unprepare(lp->clk); + clk_disable_unprepare(lp->clk); of_node_put(lp->phy_node); lp->phy_node = NULL;