From patchwork Thu Jun 30 14:13:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Yingliang X-Patchwork-Id: 12901923 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BD652CCA481 for ; Thu, 30 Jun 2022 14:19:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=R8Z1SnEYVaNePaecDBVBmNu9ZVvmS7mvBKcrSGmhI20=; b=aZhojkdxkc19Vn 21lt0L6uhGPIfsAKPd7Cs053V08xgoA+/JY/YK97Z2WSF363bHyn0BERsH9EzF+MZ9c0LBaEuWzFh FNia1TrUIPhmUTq4Uu69d41YtKgYwgn6IS05OZ3uiobCw0dXJEwWu9oq1VghsCxejM0+4pz9DdTsL spS57ojercoAngkWkQZbKmPfompR2tTEl0Jvw6xk9YMsMlBHuU+6ymfVohsy/R+ijnDCfgHYW+u13 C4/okqMMVVWVGrzpbf2uU+GbuVyDKUa+V5JZTc4JgwP/lYsLe95WkXfuvPtYp6wG5JGk2YEsMYM1U N1SfRoodGjewttt6ragg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o6uzG-00011W-3k; Thu, 30 Jun 2022 14:17:42 +0000 Received: from szxga08-in.huawei.com ([45.249.212.255]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o6ulU-00HUiU-0D for linux-arm-kernel@lists.infradead.org; Thu, 30 Jun 2022 14:03:30 +0000 Received: from dggpemm500023.china.huawei.com (unknown [172.30.72.57]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4LYg3J1xLmz1L8fD; Thu, 30 Jun 2022 22:01:00 +0800 (CST) Received: from dggpemm500007.china.huawei.com (7.185.36.183) by dggpemm500023.china.huawei.com (7.185.36.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 30 Jun 2022 22:03:17 +0800 Received: from huawei.com (10.175.103.91) by dggpemm500007.china.huawei.com (7.185.36.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 30 Jun 2022 22:03:17 +0800 From: Yang Yingliang To: , , CC: , Subject: [PATCH -next] clk: imx: remove unnecessary NULL check of clk Date: Thu, 30 Jun 2022 22:13:08 +0800 Message-ID: <20220630141308.121526-1-yangyingliang@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.175.103.91] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpemm500007.china.huawei.com (7.185.36.183) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220630_070328_307183_038FAA41 X-CRM114-Status: UNSURE ( 8.52 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org It has NULL check in clk_prepare_enable(), so it no need to check the clk before calling it. Signed-off-by: Yang Yingliang --- drivers/clk/imx/clk.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/clk/imx/clk.c b/drivers/clk/imx/clk.c index 5582f18dd632..1c5d5b957c96 100644 --- a/drivers/clk/imx/clk.c +++ b/drivers/clk/imx/clk.c @@ -189,9 +189,7 @@ void imx_register_uart_clocks(unsigned int clk_count) if (IS_ERR(imx_uart_clocks[imx_enabled_uart_clocks])) return; - /* Only enable the clock if it's not NULL */ - if (imx_uart_clocks[imx_enabled_uart_clocks]) - clk_prepare_enable(imx_uart_clocks[imx_enabled_uart_clocks++]); + clk_prepare_enable(imx_uart_clocks[imx_enabled_uart_clocks++]); } } #endif