[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH-for-5.2 3/3] hw/clock: Only propagate clock changes if the clock
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH-for-5.2 3/3] hw/clock: Only propagate clock changes if the clock is changed |
Date: |
Thu, 6 Aug 2020 14:38:58 +0200 |
Avoid propagating the clock change when the clock does not change.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
include/hw/clock.h | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/include/hw/clock.h b/include/hw/clock.h
index d85af45c96..9ecd78b2c3 100644
--- a/include/hw/clock.h
+++ b/include/hw/clock.h
@@ -165,8 +165,9 @@ void clock_propagate(Clock *clk);
*/
static inline void clock_update(Clock *clk, uint64_t value)
{
- clock_set(clk, value);
- clock_propagate(clk);
+ if (clock_set(clk, value)) {
+ clock_propagate(clk);
+ }
}
static inline void clock_update_hz(Clock *clk, unsigned hz)
--
2.21.3