Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp3075061pxu; Mon, 19 Oct 2020 03:20:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwC2vPm7SzbCngoj0i4jsvbbyjJPPDfdrr4CBM68/fjSSVf06Fs+g0WCik8gXpHCkMFTX1k X-Received: by 2002:a17:906:a1d4:: with SMTP id bx20mr16243042ejb.262.1603102806984; Mon, 19 Oct 2020 03:20:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603102806; cv=none; d=google.com; s=arc-20160816; b=uA+qOP7PskbnFGIzvwptQTxRzHQbY0SoqmKUYaYH6BJ9W2CetuldC5sPwd6tHB/uhP Xks/0dx7kHhC58l94UXd9aBkV1xyis6l19ARIwCdq4zwGgIHyHVxD8qIvJzLDSFLHKwv 4niToczYN6NW6Weas8DDmq+NPyNM1aGg22fpxSIHsKh/rI+rRDorc/0mrYjn0KQ84htb qixlAJ8vM5GY7qzNxKh8sEB/hEcCd2J/DUq3TB6+zrJfnjtJ0niAaaNhYTxbQfZJg5gs RcK7at892wzYnI6WCZ3bOg5/Y5yCFiwsXSYovGbpV09nOP//OY42lY0EpnRx6jEwdLMI m/7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:to:from; bh=Xe+OlyL2tYw1WXbtAjps5FHN7xCbQRTUhLXblmmR15M=; b=fUPShYAHd8tkQVv7lQj0O66GuLmEEM6zsnjCzLXRLRsF7O9p8zdJ8Ruxt9kvrUppHZ lhXjRguGl0GCt9kkqruwPT75mE5BcExyo6qMha/RDDSQkTH4UETVSLfoyVXlJ95NN7C3 1TUpLys1SKSprwolUI591bSb0WcCpUT0X6dl/txlsmsVqyLf+jWDo0VrHKZ2+dcI249g rZvpUPwloUungTkysOec6oauejYIQVbVRqjBDpCrkpsduw8Di9mdT4m1CqpCkw2iQKyo S5eiA0dkJZEhvcaICmAHY8Q++PiQx61lcY/WostzK1oSjb1isZYNFWR538aDwHnShrwB gE0A== 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 p16si7260647edy.344.2020.10.19.03.19.44; Mon, 19 Oct 2020 03:20:06 -0700 (PDT) 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 S1726543AbgJSGDq (ORCPT + 99 others); Mon, 19 Oct 2020 02:03:46 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:47814 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725306AbgJSGDp (ORCPT ); Mon, 19 Oct 2020 02:03:45 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 7427091F64E8CB318596; Mon, 19 Oct 2020 14:03:41 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.487.0; Mon, 19 Oct 2020 14:03:37 +0800 From: Tian Tao To: , , , , , , , Subject: [PATCH] drm/msm: Remove redundant null check Date: Mon, 19 Oct 2020 14:04:22 +0800 Message-ID: <1603087462-37505-1-git-send-email-tiantao6@hisilicon.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org clk_prepare_enable() and clk_disable_unprepare() will check NULL clock parameter, so It is not necessary to add additional checks. Signed-off-by: Tian Tao --- drivers/gpu/drm/msm/msm_gpu.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c index 57ddc94..25bc654 100644 --- a/drivers/gpu/drm/msm/msm_gpu.c +++ b/drivers/gpu/drm/msm/msm_gpu.c @@ -175,15 +175,12 @@ static int disable_clk(struct msm_gpu *gpu) static int enable_axi(struct msm_gpu *gpu) { - if (gpu->ebi1_clk) - clk_prepare_enable(gpu->ebi1_clk); - return 0; + return clk_prepare_enable(gpu->ebi1_clk); } static int disable_axi(struct msm_gpu *gpu) { - if (gpu->ebi1_clk) - clk_disable_unprepare(gpu->ebi1_clk); + clk_disable_unprepare(gpu->ebi1_clk); return 0; } -- 2.7.4