Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp645791iog; Thu, 30 Jun 2022 07:35:47 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s3X3oCwDLh8rMy0AGdMBHevi6TeNagcGhW9YOdHoVgC1bWrtLwzwf7kSk6Tp9C3kLBltkG X-Received: by 2002:a17:902:f60d:b0:16a:1a7f:a22f with SMTP id n13-20020a170902f60d00b0016a1a7fa22fmr14779486plg.13.1656599746912; Thu, 30 Jun 2022 07:35:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656599746; cv=none; d=google.com; s=arc-20160816; b=Ft8C+rGuVC9UcX39CRkYsVzrJdTc/1dqhf9/CxRL3scLkhUgTSJIyMoAiw6qsjh+s9 hIBnPYhCCrHkALvaSR/OSJ97G81+6iwYclQfMTwWnCsq51DEzHNrBMzWAUqtP6YWBS9A uYnzjkXmNYCbSve6MJyF0ICIXAvkdiRhvgTd2RgZIhuScTf8tJbPO9XEZu6MJQKPfhRL rUKKa/JruAaJIc9MEknGLQzMo7wFfuqneSLq+Bcyjm2jr8thFmAPM5ElVNFVr43uF1O2 8fgXRZ1nVR7/jKJ57q6HI1shf9nxqxot9B6jJLJzcK0yCCiPWqlBWt83phIAb8qeKWRT O8hA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=NABxPIA7MmpFJNbcJZC+sYHyFxg9YFQF7vvjvXn/wwE=; b=eArw3WrnpjtHuKpQ7gYyeAD58K2uhIE+7fb4bgbNdlXFxN9ttwZESD8fywxfycLSES 0SdrefcHOTrHjKNpgmHau+IzGneFmnIGimbgwZpoOKMZyp4TPTneGiVIujux+ld4C7Eo NGPT5U6hM2iBr3zmAMzJSga6jevBuIvwvmjnDYdnlCEoyk8PpV5b8dCRXqK/mFy+yg0u 9CRiXMgmsM553UC+npgTxIufDwIDGuzWE081SBk9CqOj8DUhopZt41xP5hHqXRb7C10p AH6G/BN6MSsO2XogCF/mhQ7O9n7Ciy1lJMge02G7qo8qsOsRTu1e44Ohx/poe3QxO0G6 HQcw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v24-20020a63d558000000b00408c3dbe263si24290210pgi.453.2022.06.30.07.35.35; Thu, 30 Jun 2022 07:35:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237049AbiF3OTa (ORCPT + 99 others); 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: 7BIT Content-Type: text/plain; charset=US-ASCII 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-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 -- 2.25.1