[PATCH v4] ACPI / amba: Drop unnecessary check for registered amba_dummy_clk

Youwan Wang posted 1 patch 1 year, 5 months ago
drivers/acpi/arm64/amba.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
[PATCH v4] ACPI / amba: Drop unnecessary check for registered amba_dummy_clk
Posted by Youwan Wang 1 year, 5 months ago
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>
Acked-by: Sudeep Holla <sudeep.holla@arm.com>
Acked-by: Hanjun Guo <guohanjun@huawei.com>
---
v1->v2->v3: Modify the commit log description
v3->v4: Update the commit message suggested by Sudeep;
        Add Acked-by from Sudeep;
        +Cc ARM64 maintainers Catalin and Will.
---
 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
Re: [PATCH v4] ACPI / amba: Drop unnecessary check for registered amba_dummy_clk
Posted by Catalin Marinas 1 year, 5 months ago
On Mon, 24 Jun 2024 10:31:01 +0800, Youwan Wang wrote:
> 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.
> 
> 
> [...]

Applied to arm64 (for-next/acpi), thanks!

[1/1] ACPI / amba: Drop unnecessary check for registered amba_dummy_clk
      https://git.kernel.org/arm64/c/bfe3f0df3e3c

-- 
Catalin
Re: [PATCH v4] ACPI / amba: Drop unnecessary check for registered amba_dummy_clk
Posted by Sudeep Holla 1 year, 5 months ago
On Mon, Jun 24, 2024 at 10:31:01AM +0800, Youwan Wang wrote:
> 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>
> Acked-by: Sudeep Holla <sudeep.holla@arm.com>
> Acked-by: Hanjun Guo <guohanjun@huawei.com>
> ---

Hi Catalin,

Can you please pick up this simple cleanup patch under ACPI changes ?
It is very hard to follow the versions as it is messed up, but this
version is good to take though.

--
Regards,
Sudeep
Re: [PATCH v4] ACPI / amba: Drop unnecessary check for registered amba_dummy_clk
Posted by Sudeep Holla 1 year, 5 months ago
On Mon, Jun 24, 2024 at 10:31:01AM +0800, Youwan Wang wrote:
> 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>
> Acked-by: Sudeep Holla <sudeep.holla@arm.com>
> Acked-by: Hanjun Guo <guohanjun@huawei.com>
> ---
> v1->v2->v3: Modify the commit log description
> v3->v4: Update the commit message suggested by Sudeep;
>         Add Acked-by from Sudeep;
>         +Cc ARM64 maintainers Catalin and Will.


I think I have told you many time now and you are missing to understand
few basic stuff. So I suggest to give
`Documentation/process/submitting-patches.rst`
under the kernel source a read and especially the section
`The canonical patch format`

Ideally this patch should have been v5 as you added Hanjun's Ack
Also "v1->v2->v3: Modify the commit log description" makes no sense.

The changelog should list all the deltas like:
v4->v5:
	- <blah3 blah3>
v3->v4:
	- <blah2 blah2>
v2->v3:
	- <blah1 blah1>
v1->v2:
	- <blah blah>

Anyways, it is only for your learning and future references.

--
Regards,
Sudeep