Re: [PATCH v1] ACPI /amba: Fix meaningless code for amba_register_dummy_clk()

From: Hanjun Guo
Date: Tue Jun 18 2024 - 02:47:40 EST


On 2024/6/16 21:05, Christophe JAILLET wrote:
Le 16/06/2024 à 12:00, Youwan Wang a écrit :
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.

Hi,

 can you elaborate on this "will always be NULL"?

I think that it is NULL on the first call of amba_register_dummy_clk(), but if it is called again, it will have the value of clk_register_fixed_rate() just a few lines after, doing exactly what the comment says.

I think Youwan is arguing that amba_register_dummy_clk() will
never be called more than once, so the static define and check is
redundant.

Thanks
Hanjun