hw/clock: Only propagate clock changes if the clock is changed
Avoid propagating the clock change when the clock does not change. Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20200806123858.30058-4-f4bug@amsat.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
15aa2876d9
commit
96250eab90
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user