linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ACPI / amba: Drop unnecessary check for registered amba_dummy_clk
@ 2024-06-20  0:59 Youwan Wang
  2024-06-20  8:38 ` Sudeep Holla
  0 siblings, 1 reply; 4+ messages in thread
From: Youwan Wang @ 2024-06-20  0:59 UTC (permalink / raw)
  To: lpieralisi
  Cc: guohanjun, linux-kernel, linux-arm-kernel, lenb, rafael,
	sudeep.holla, linux-acpi, Youwan Wang

amba_register_dummy_clk() is called only once from acpi_amba_init()
and acpi_amba_init() itself is called once during the initialisation.
amba_dummy_clk can't be initialised before this in any other code
path and hence the check for already registered amba_dummy_clk is
not necessary. Drop the same.

Signed-off-by: Youwan Wang <youwan@nfschina.com>
---
 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);
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread
* [PATCH v3] ACPI /amba: Fix meaningless code for amba_register_dummy_clk()
@ 2024-06-18 11:58 Youwan Wang
  2024-06-20 13:37 ` [PATCH] ACPI / amba: Drop unnecessary check for registered amba_dummy_clk Youwan Wang
  0 siblings, 1 reply; 4+ messages in thread
From: Youwan Wang @ 2024-06-18 11:58 UTC (permalink / raw)
  To: lpieralisi
  Cc: guohanjun, linux-kernel, linux-arm-kernel, lenb, rafael,
	sudeep.holla, linux-acpi, Youwan Wang

Defining `amba_dummy_clk` as static is meaningless.

The amba_register_dummy_clk() function is static and
is called during initialization. I think 'amba_dummy_clk'
should be NULL each time when initializing

Signed-off-by: Youwan Wang <youwan@nfschina.com>
---
 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);
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-06-24  2:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-20  0:59 [PATCH] ACPI / amba: Drop unnecessary check for registered amba_dummy_clk Youwan Wang
2024-06-20  8:38 ` Sudeep Holla
  -- strict thread matches above, loose matches on Subject: below --
2024-06-18 11:58 [PATCH v3] ACPI /amba: Fix meaningless code for amba_register_dummy_clk() Youwan Wang
2024-06-20 13:37 ` [PATCH] ACPI / amba: Drop unnecessary check for registered amba_dummy_clk Youwan Wang
2024-06-24  2:09   ` Hanjun Guo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).