diff mbox series

ACPI / amba: Drop unnecessary check for registered amba_dummy_clk

Message ID 20240620133758.319392-1-youwan@nfschina.com
State Superseded
Headers show
Series ACPI / amba: Drop unnecessary check for registered amba_dummy_clk | expand

Commit Message

Youwan Wang June 20, 2024, 1:37 p.m. UTC
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>
---
v1->v2->v3: Modify the commit log description
---
 drivers/acpi/arm64/amba.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

Comments

Hanjun Guo June 24, 2024, 2:09 a.m. UTC | #1
Hi Youwan,

Please use v4 for your patch subject which was suggested by Sudeep:

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

On 2024/6/20 21:37, 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>
> ---
> v1->v2->v3: Modify the commit log description

Please update it as follows:

Changes from v3:
- 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);

With that updated,

Acked-by: Hanjun Guo <guohanjun@huawei.com>

Thanks
Hanjun
Sudeep Holla June 24, 2024, 2:48 p.m. UTC | #2
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
Sudeep Holla June 24, 2024, 3:02 p.m. UTC | #3
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
diff mbox series

Patch

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);