Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1084797pxb; Tue, 3 Nov 2020 22:47:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJykFQ0UIodr+sFMzDvr7tColyFt1jzfOrmgjj5W9kub0ormqHw2F6jViU0EzIXOqCofzky5 X-Received: by 2002:a50:8064:: with SMTP id 91mr3693100eda.172.1604472438529; Tue, 03 Nov 2020 22:47:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604472438; cv=none; d=google.com; s=arc-20160816; b=EcxPPU9G61L8Ure9sCJ8zfoqZbK/dsodXSUWzkXI7lpSbVChPmqLv6mvzpB2w8iMyT uPrQIlwOt35i8dJHkb8OSHsfjJykutGkuXRUbkXE4KTLRpCW6ao+ULh2vzTfAZKunZ4b ZMuztAXObvdwKji5xhfE56gbfzxqMAB1WY2U+K8wl2GyQ6iTikyXkK0yp3zoMo4ghGWo S2siEeccF+g8eg6ShYNgx8PrX+nif4bavlIO1oj5X7lTkjivsmrUPaoXPOeXgo7tqm7p P6IWbQzHMRLLYe2O4b3s3KeXq/otKcO9YbRnr3JOv6Nfjq2fB/itZRexto5MnWTaSypB XQzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=U9OtrZLeqB9dlE+QMmLBRpLMAaPq1SzMA8Kuz+51VSo=; b=YPkb77DUR2NUzL/c7vFzSVHEyACHV9DRZvq0dza5tgKjSUv1PXc2vWle6hgxX+SvJj acNFajpUuhWpA1YTJtGOFgOfUPgfrICpv+Genq8KyhRGuDjzVxB0CiKY64ZgHkku/PMM 1sdeB0TjUUJ9YcjKM5RkLdYlHBStCF4gLlNykf5nBjYOLIPbO/sIYXDwOXzWEKrKQnea exnpoIj6mx8+sXbBcSDImDi+v9Gtr0/6yIx2mQnXQ0np6nPVL2YS4zN/mJW2DOKH/wAN QgnS2PTNggHtwmGLFhRStsI4LilWbvBu5Tdy4NaCl8sMSMWIpBz+OnYLMwaiyisN6/hS WMlw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w1si676654edf.49.2020.11.03.22.46.56; Tue, 03 Nov 2020 22:47:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727110AbgKDGpb (ORCPT + 99 others); Wed, 4 Nov 2020 01:45:31 -0500 Received: from smtp25.cstnet.cn ([159.226.251.25]:56952 "EHLO cstnet.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725926AbgKDGpb (ORCPT ); Wed, 4 Nov 2020 01:45:31 -0500 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 Cc: linux-kernel@vger.kernel.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: 1UD129KBjvdXoWrZFy8CFyfJFyxWr4xXr4UXFb_yoWkGrXEva n7Kw4kWr4rAwnav3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kernel@vger.kernel.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; -- 2.17.1