[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH-for-9.0 v2 1/8] hw/clock: Have clock_set_mul_div() return ear
From: |
Alistair Francis |
Subject: |
Re: [PATCH-for-9.0 v2 1/8] hw/clock: Have clock_set_mul_div() return early when nothing to change |
Date: |
Tue, 26 Mar 2024 13:13:41 +1000 |
On Mon, Mar 25, 2024 at 11:34 PM Philippe Mathieu-Daudé
<philmd@linaro.org> wrote:
>
> Return early when clock_set_mul_div() is called with
> same mul/div values the clock has.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Alistair
> ---
> hw/core/clock.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/hw/core/clock.c b/hw/core/clock.c
> index d82e44cd1a..c73f0c2f98 100644
> --- a/hw/core/clock.c
> +++ b/hw/core/clock.c
> @@ -147,6 +147,10 @@ void clock_set_mul_div(Clock *clk, uint32_t multiplier,
> uint32_t divider)
> {
> assert(divider != 0);
>
> + if (clk->multiplier == multiplier && clk->divider == divider) {
> + return;
> + }
> +
> trace_clock_set_mul_div(CLOCK_PATH(clk), clk->multiplier, multiplier,
> clk->divider, divider);
> clk->multiplier = multiplier;
> --
> 2.41.0
>
>
- [PATCH-for-9.0? v2 0/8] hw/clock: Propagate clock changes when STM32L4X5 MUX is updated, Philippe Mathieu-Daudé, 2024/03/25
- [PATCH-for-9.0 v2 1/8] hw/clock: Have clock_set_mul_div() return early when nothing to change, Philippe Mathieu-Daudé, 2024/03/25
- Re: [PATCH-for-9.0 v2 1/8] hw/clock: Have clock_set_mul_div() return early when nothing to change,
Alistair Francis <=
- [PATCH-for-9.0? v2 2/8] hw/clock: Pass optional &bool argument to clock_set(), Philippe Mathieu-Daudé, 2024/03/25
- Re: [PATCH-for-9.0? v2 2/8] hw/clock: Pass optional &bool argument to clock_set(), Peter Maydell, 2024/03/25
- Re: [PATCH-for-9.0? v2 2/8] hw/clock: Pass optional &bool argument to clock_set(), Philippe Mathieu-Daudé, 2024/03/25
- Re: [PATCH-for-9.0? v2 2/8] hw/clock: Pass optional &bool argument to clock_set(), Peter Maydell, 2024/03/25
- Re: [PATCH-for-9.0? v2 2/8] hw/clock: Pass optional &bool argument to clock_set(), Philippe Mathieu-Daudé, 2024/03/25
- Re: [PATCH-for-9.0? v2 2/8] hw/clock: Pass optional &bool argument to clock_set(), Peter Maydell, 2024/03/25
- Re: [PATCH-for-9.0? v2 2/8] hw/clock: Pass optional &bool argument to clock_set(), Philippe Mathieu-Daudé, 2024/03/25
- Re: [PATCH-for-9.0? v2 2/8] hw/clock: Pass optional &bool argument to clock_set(), Philippe Mathieu-Daudé, 2024/03/25
[PATCH-for-9.0? v2 3/8] hw/clock: Pass optional &bool argument to clock_set_ns(), Philippe Mathieu-Daudé, 2024/03/25
[PATCH-for-9.0? v2 4/8] hw/clock: Pass optional &bool argument to clock_set_hz(), Philippe Mathieu-Daudé, 2024/03/25