From patchwork Wed Nov 4 06:45:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xu Wang X-Patchwork-Id: 11879703 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1C6DFC2D0A3 for ; Wed, 4 Nov 2020 06:46:55 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 876342222B for ; Wed, 4 Nov 2020 06:46:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="18DHylyq" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 876342222B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=iscas.ac.cn Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-Id:Date:Subject: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=wu5yT3hL2L5X96P4YK7RlJjiQ/XUDZEHh5XI6xO+skg=; b=18DHylyqCynO6L92lQaIUh2eSK XfcQQH7JXLdxDqtYbAMBMioPS1IS241q6iwnuEyKLit1WiRxdN21hAilpGtpBVRrOKMBIfat16Wk+ 79ajRpNn+AMJVFvuVW4wz66p0DAUsOVbX05aTOQSXw7k13E1Cz9y6htLNZD4VheabQp8hb8zU4aX7 04QFPw3tBh1MP74gfRLTiB+7JjcO29nw/M/XBwbtipFQZpOn5hbSqGX8WWpkHMICufGaXFaPDxFLM dYiBSS9Q9nA7nJvZtyF5A4sOfY4FtUlEzn7JUgoQmuNr+biiJAvaU+lHQg6uopY3WZI1yDzj5UZVc /IlSomWA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kaCXq-0004X8-Bz; Wed, 04 Nov 2020 06:45:22 +0000 Received: from smtp25.cstnet.cn ([159.226.251.25] helo=cstnet.cn) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kaCXm-0004WI-Nh for linux-arm-kernel@lists.infradead.org; Wed, 04 Nov 2020 06:45:20 +0000 Received: from localhost.localdomain (unknown [124.16.141.241]) by APP-05 (Coremail) with SMTP id zQCowACXh1DzTaJfb3v7AA--.33898S2; Wed, 04 Nov 2020 14:45:08 +0800 (CST) From: Xu Wang To: tony@atomide.com, linux@armlinux.org.uk, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] ARM: OMAP2+: Remove redundant null check before clk_prepare_enable/clk_disable_unprepare Date: Wed, 4 Nov 2020 06:45:05 +0000 Message-Id: <20201104064505.5737-1-vulab@iscas.ac.cn> X-Mailer: git-send-email 2.17.1 X-CM-TRANSID: zQCowACXh1DzTaJfb3v7AA--.33898S2 X-Coremail-Antispam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yxotu46lvutnvoduhdfq/1tbiCQYKA102Zr6PwwAAs5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201104_014519_337008_AEC4D882 X-CRM114-Status: UNSURE ( 8.51 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Because clk_prepare_enable() and clk_disable_unprepare() already checked NULL clock parameter, so the additional checks are unnecessary, just remove them. Signed-off-by: Xu Wang --- arch/arm/mach-omap2/display.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c index 2000fca6bd4e..6daaa645ae5d 100644 --- a/arch/arm/mach-omap2/display.c +++ b/arch/arm/mach-omap2/display.c @@ -385,8 +385,7 @@ int omap_dss_reset(struct omap_hwmod *oh) } for (i = oh->opt_clks_cnt, oc = oh->opt_clks; i > 0; i--, oc++) - if (oc->_clk) - clk_prepare_enable(oc->_clk); + clk_prepare_enable(oc->_clk); dispc_disable_outputs(); @@ -412,8 +411,7 @@ int omap_dss_reset(struct omap_hwmod *oh) pr_debug("dss_core: softreset done\n"); for (i = oh->opt_clks_cnt, oc = oh->opt_clks; i > 0; i--, oc++) - if (oc->_clk) - clk_disable_unprepare(oc->_clk); + clk_disable_unprepare(oc->_clk); r = (c == MAX_MODULE_SOFTRESET_WAIT) ? -ETIMEDOUT : 0;