From patchwork Sun Jun 16 10:00:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Youwan Wang X-Patchwork-Id: 13699511 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DF6B8C27C53 for ; Sun, 16 Jun 2024 10:01:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=J9w4rECaErsFh4/ggeDgBQ7D12bQ0dP3XZOf9JDvZ6k=; b=zH5p2C26pccMtmCfQHRpDXALBs t4HzuiH0+Uwy9S3O1bZC/h8bnLkpPrHjUpThzEDpNZaUu1tX6dBSO4omCwpjWjQ2YsFhtyKrQ/N4D DGLhOgIs7zLPpAMzZru25v004Zy16i/Gvn0t/VJP4Nmg5vi+nDaf163kXeGU6+H9u+/LEw4glnjvG KFW1AxiQOvbGEORs6ruDTLsknXwzjjj2RLbX6xSBpUupUBMB0BeoA5EsX8Bhd2i7Lqk6stzUDL2Vs Nre2JjH0lu+fBUT7G+aioCKazmUF+OpSCbMFD55QZcGGMHdhNtNwtHcaWLdLaGdp5kjlcX39SWyvF FYXOhV6A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sImhD-00000007HuQ-1q4n; Sun, 16 Jun 2024 10:01:11 +0000 Received: from [42.101.60.195] (helo=mail.nfschina.com) by bombadil.infradead.org with smtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sImh8-00000007Hte-43El for linux-arm-kernel@lists.infradead.org; Sun, 16 Jun 2024 10:01:08 +0000 Received: from localhost.localdomain (unknown [103.163.180.2]) by mail.nfschina.com (Maildata Gateway V2.8.8) with ESMTPA id 3D8EE60108B70; Sun, 16 Jun 2024 18:01:02 +0800 (CST) X-MD-Sfrom: youwan@nfschina.com X-MD-SrcIP: 103.163.180.2 From: Youwan Wang To: lpieralisi@kernel.org Cc: guohanjun@huawei.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, lenb@kernel.org, Youwan Wang Subject: [PATCH v1] ACPI /amba: Fix meaningless code for amba_register_dummy_clk() Date: Sun, 16 Jun 2024 18:00:54 +0800 Message-Id: <20240616100054.241482-1-youwan@nfschina.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240616_030107_223226_58251923 X-CRM114-Status: UNSURE ( 9.72 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Defining `amba_dummy_clk` as static is meaningless. The conditional check `if (amba_dummy_clk)` is intended to determine whether the clock has already been registered. However,in this function, the variable `amba_dummy_clk` will always be NULL. Signed-off-by: Youwan Wang --- drivers/acpi/arm64/amba.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/acpi/arm64/amba.c b/drivers/acpi/arm64/amba.c index 60be8ee1dbdc..ef438417cc80 100644 --- a/drivers/acpi/arm64/amba.c +++ b/drivers/acpi/arm64/amba.c @@ -35,11 +35,7 @@ static const struct acpi_device_id amba_id_list[] = { static void amba_register_dummy_clk(void) { - static struct clk *amba_dummy_clk; - - /* If clock already registered */ - if (amba_dummy_clk) - return; + struct clk *amba_dummy_clk; amba_dummy_clk = clk_register_fixed_rate(NULL, "apb_pclk", NULL, 0, 0); clk_register_clkdev(amba_dummy_clk, "apb_pclk", NULL);