From nobody Sun Apr 19 13:54:35 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 19503C433EF for ; Thu, 30 Jun 2022 14:19:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237052AbiF3OTa (ORCPT ); Thu, 30 Jun 2022 10:19:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237772AbiF3OSx (ORCPT ); Thu, 30 Jun 2022 10:18:53 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4474D88F0E; Thu, 30 Jun 2022 07:03:21 -0700 (PDT) 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 Content-Transfer-Encoding: quoted-printable 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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; =20 - /* 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 --=20 2.25.1