Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp612705imn; Fri, 29 Jul 2022 18:07:46 -0700 (PDT) X-Google-Smtp-Source: AA6agR4hfORTsxIpEv7rhr3hK9y+Hk0jfEkj1ZTKEdVs3VmtweG1ozGlTaNB6koolR8HUPB8MDif X-Received: by 2002:a17:90b:350c:b0:1f2:becd:55f3 with SMTP id ls12-20020a17090b350c00b001f2becd55f3mr6689082pjb.99.1659143266536; Fri, 29 Jul 2022 18:07:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659143266; cv=none; d=google.com; s=arc-20160816; b=ZQx+rxCrm+qRHF+RDah4dfTCKm7Q3oyd/kT4YCoa3A9MWruTVbONo5NDjArhE2R2i3 4hhfYk8l4NTWBSY6vcD0SNOuLNr9EUOrzJA0lPNmEgorLWivnAlFY8HHF+GYLDsRYG1t EZy0WA2i429LFu5zgHve+0OsY7YFqKm7GS43ZEfwtII/EXMkfAvrNJnAva6XdYeNtrWL 1cAB5Yrf50n06OVCeZTJ8Ikr7/tA4c5zGYTacHrK+nXKwwzYfKOSuUCzOUWVDLjSOFH8 HkYpFvHcs9WMWjzUlYKQ5Da8spSBsXoz/W1trVmYBX7YFMF4dqC2F44IN7IWdHXyZTlk jaMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:user-agent:date:to:cc:from:subject :references:in-reply-to:content-transfer-encoding:mime-version :dkim-signature; bh=SU+rSwo97kD1C6E/OMlnYaiMbgmnREuOi/KaiSXwLaA=; b=taJ72z55criGzEF3R9vmYn6r50eUVXAmsRM1o5471+3D26S4Z60GDoyqNY0oOqmc2t 16z4IsPXuHQ9hpVszQW/HPdfuqrj320LqpZnYQ6zt9d9hUFIZF3eBhjVXEf0KGGBmuRh 607yOCmlyf20OfAEYKZy/d0yAI1iXPlPWOpsD69Rs9YZcydDcf4YztOjVglesNuW5EUy y8exr6HfTlwcvegqJoInvhBdnLmtQAuaDwnoAdcmfnOAfLnCIn6RXMu3rrVfTFDgV5gN EsVEZh4s7QPtLzV+RdZuPvKOO6GCGh3AF5oxjxBchFh8043JL4VY/+LcCXEhDTM2jbtz VzhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hey4AyJj; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w9-20020aa78589000000b0052ae5ef0149si4989417pfn.230.2022.07.29.18.07.22; Fri, 29 Jul 2022 18:07: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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hey4AyJj; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232112AbiG3BBB (ORCPT + 99 others); Fri, 29 Jul 2022 21:01:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229599AbiG3BA7 (ORCPT ); Fri, 29 Jul 2022 21:00:59 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F3C6814A8; Fri, 29 Jul 2022 18:00:59 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id CAB11B829FD; Sat, 30 Jul 2022 01:00:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7CF6BC433D6; Sat, 30 Jul 2022 01:00:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1659142856; bh=+InU6DDPWuuUM25a8VhayS37OQxLsx3tuBE0/qqb3aA=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=hey4AyJjXGgwdIeZX+TIzwM0uRat9O61ztXTZTuz1MtO1arOYvAm52jlnKF6+uT74 WLRjvmkUvS6tWu6u220VrmU8g3ysvF31VTiZUEAjKbtwFb1jTaZrGfl5GpngYisqHb skb3PpWxzDzXdMkuRlwh1uqAyScOodeBVnpJsZ6Ty9zvbX7IGJrpa8WuZPOHscPUd2 2U7K/OVSQAzHCAhwEDCa3lZ8Bpk57K0t599odFuwhOproYWXSQUmgdOG7aXizyE+vL 4EkAFs8YXu9IzhEU0y37dLo50V1mp/FgsnC8AyHOPeWGHLPcj+ecAOmJ0tkMogHgVT bwINbV5mMAZdg== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <20220630141308.121526-1-yangyingliang@huawei.com> References: <20220630141308.121526-1-yangyingliang@huawei.com> Subject: Re: [PATCH -next] clk: imx: remove unnecessary NULL check of clk From: Stephen Boyd Cc: abelvesa@kernel.org, shawnguo@kernel.org To: Yang Yingliang , linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Date: Fri, 29 Jul 2022 18:00:54 -0700 User-Agent: alot/0.10 Message-Id: <20220730010056.7CF6BC433D6@smtp.kernel.org> X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 Quoting Yang Yingliang (2022-06-30 07:13:08) > It has NULL check in clk_prepare_enable(), so it no need > to check the clk before calling it. >=20 > Signed-off-by: Yang Yingliang > --- > drivers/clk/imx/clk.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) >=20 > 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_clock= s])) > 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_en= abled_uart_clocks++]); > + clk_prepare_enable(imx_uart_clocks[imx_enabled_ua= rt_clocks++]); Nak The ++ operator has side-effects, which wasn't the case before this patch.