From 94da7b6e9ad8da2b0cb2ef86a64d9fa1d6c8320c Mon Sep 17 00:00:00 2001 From: Zhao Liu Date: Thu, 18 Apr 2024 18:07:16 +0800 Subject: [PATCH] accel/tcg/icount-common: Consolidate the use of warn_report_once() Use warn_report_once() to get rid of the static local variable "notified". Signed-off-by: Zhao Liu Message-ID: <20240418100716.1085491-1-zhao1.liu@linux.intel.com> Signed-off-by: Paolo Bonzini --- accel/tcg/icount-common.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/accel/tcg/icount-common.c b/accel/tcg/icount-common.c index a4a747d1dc9..8d3d3a7e9dc 100644 --- a/accel/tcg/icount-common.c +++ b/accel/tcg/icount-common.c @@ -336,10 +336,8 @@ void icount_start_warp_timer(void) deadline = qemu_clock_deadline_ns_all(QEMU_CLOCK_VIRTUAL, ~QEMU_TIMER_ATTR_EXTERNAL); if (deadline < 0) { - static bool notified; - if (!icount_sleep && !notified) { - warn_report("icount sleep disabled and no active timers"); - notified = true; + if (!icount_sleep) { + warn_report_once("icount sleep disabled and no active timers"); } return; } -- 2.39.5