diff options
author | Zhao Liu <zhao1.liu@intel.com> | 2024-04-18 18:07:16 +0800 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2024-04-23 17:35:26 +0200 |
commit | 94da7b6e9ad8da2b0cb2ef86a64d9fa1d6c8320c (patch) | |
tree | 0352bb1d8dfcba0d57004af785f8a1ae9d99a306 /accel | |
parent | aec202cb0eb800049c85428ba31566a9ef634cfc (diff) | |
download | qemu-94da7b6e9ad8da2b0cb2ef86a64d9fa1d6c8320c.zip qemu-94da7b6e9ad8da2b0cb2ef86a64d9fa1d6c8320c.tar.gz qemu-94da7b6e9ad8da2b0cb2ef86a64d9fa1d6c8320c.tar.bz2 |
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 <zhao1.liu@intel.com>
Message-ID: <20240418100716.1085491-1-zhao1.liu@linux.intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'accel')
-rw-r--r-- | accel/tcg/icount-common.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/accel/tcg/icount-common.c b/accel/tcg/icount-common.c index a4a747d..8d3d3a7 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; } |